2017-06-17 90 views
-5

我有錯誤:致命錯誤的WordPress

Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /home/keramxd/domains/coaching.yotta.style/public_html/wp-content/themes/video/functions.php:60 Stack trace: #0 /home/keramxd/domains/coaching.yotta.style/public_html/wp-settings.php(424): include() #1 /home/keramxd/domains/coaching.yotta.style/public_html/wp-config.php(97): require_once('/home/keramxd/d...') #2 /home/keramxd/domains/coaching.yotta.style/public_html/wp-load.php(37): require_once('/home/keramxd/d...') #3 /home/keramxd/domains/coaching.yotta.style/public_html/wp-blog-header.php(13): require_once('/home/keramxd/d...') #4 /home/keramxd/domains/coaching.yotta.style/public_html/index.php(17): require('/home/keramxd/d...') #5 {main} thrown in /home/keramxd/domains/coaching.yotta.style/public_html/wp-content/themes/video/functions.php on line 60

我在functions.php的60行:

if ($wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string($_SERVER['REQUEST_URI']).'"') == '1') 
+1

可能重複[mysql \ _real \ _escape \ _string是未定義的](https://stackoverflow.com/questions/13856639/mysql-real-escape-string-is-undefined) – HPierce

+0

我將PHP更改爲5.7和I見網站。接下來的錯誤: 不推薦使用:mysql_escape_string():此函數已棄用;請改用mysql_real_escape_string()。 in /home/keramxd/domains/coaching.yotta.style/public_html/wp-content/themes/video/functions.php on line 60 警告:無法修改標題信息 - 已經發送的標題(在/ home/keramxd/domains/coaching.yotta.style/public_html/wp-content/themes/video/functions.php:60)在/home/keramxd/domains/coaching.yotta.style/public_html/wp-includes/pluggable.php上line 1210 – Marek

+0

12g in pluggable.php: \t header(「Location:$ location」,true,$ status); – Marek

回答

-1

對於PHP 4.3.0,這個功能deprecated,它是在PHP中刪除, 7.0.0

從cale_b評論:

由於這是WordPress的,你應該使用改爲。

+0

我將PHP更改爲5.7,並看到網站。接下來的錯誤:已棄用:mysql_escape_string():此函數已棄用;請改用mysql_real_escape_string()。在/home/keramxd/domains/coaching.yotta.style/public_html/wp-co ntent/themes/video/f unctions.php on line 60警告:無法修改標題信息 - 已經發送的標題(輸出開始於/ home/keramxd/domains/coaching.yotta.style/public_html/wp-co ntent/themes/video/f unctions.php:60)in /home/keramxd/domains/coaching.yotta.style/public_html/wp-在線1210 – Marek

+0

行1210在pluggable.php中:header(「Location:$ location」,true,$ status); – Marek

+0

這些錯誤中的第一個將通過執行我所說的並使用mysqli_而不是mysql_ – JohnCH