简体   繁体   中英

Error in WordPress while establishing connection to database

mrtechnic.com 并且我无法打开我的网站,这给了我这个错误。

Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /srv/users/serverpilot/apps/mrtechnic/public/wp-content/themes/bimber/functions.php:60 Stack trace: #0 /srv/users/serverpilot/apps/mrtechnic/public/wp-settings.php(425): include() #1 /srv/users/serverpilot/apps/mrtechnic/public/wp-config.php(30): require_once('/srv/users/serv...') #2 /srv/users/serverpilot/apps/mrtechnic/public/wp-load.php(37): require_once('/srv/users/serv...') #3 /srv/users/serverpilot/apps/mrtechnic/public/wp-admin/maint/repair.php(10): require_once('/srv/users/serv...') #4 {main} thrown in /srv/users/serverpilot/apps/mrtechnic/public/wp-content/themes/bimber/functions.php on line 60

mysql_escape_string() is a deprecated function that was removed entirely in PHP7. Your error is because that function is no longer available. You need to update the code.

Keep in mind that in WordPress you shouldn't be interacting with the database using native functions. Use the wpdb class instead.

WPDB: https://codex.wordpress.org/Class_Reference/wpdb

mysql_escape_string docs: http://php.net/manual/en/function.mysql-escape-string.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM