0
我收到該錯誤,正在處理WordPress後期更新如何解決該問題?更新記錄時出錯:您的SQL語法中有錯誤
[videojs_hls URL = 'http://mn-i.mncdn.com/foxtv_mobile/smil:foxtv.smil/playlist.m3u8?token=c31bfe38167986e4922c0394488c4bf69639aeaf47863c7b '自動播放=' 真']錯誤更新記錄:您的SQL語法錯誤;檢查對應於您MariaDB的服務器版本正確的語法在1號線
使用近「http://mn-i.mncdn.com/foxtv_mobile/smil:foxtv.smil/playlist.m3u8?token=c31bfe381」而我的代碼手冊:
$site_url = "http://site.com.tr/live";
$site = file_get_contents($site_url);
preg_match('@src : \'(.*?)\',@si',$site,$token);
$newcontent = "[videojs_hls url='$token[1]' autoplay='true']";
echo $newcontent;
$servername = "localhost";
$username = "xxx";
$password = "xxx";
$dbname = "xxx";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE wp_posts SET post_content='$newcontent' WHERE ID=33";
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
謝謝!解決了 –