2017-06-17 75 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