I have wordpress with woocommerce, for some reason my site is not working after I updated the site, and I'm getting:
Uncaught Error: Call to undefined function mysql_escape_string()
I enabled the debug in wordpress, and it says:
fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /home/homedirecty/mysite.ca/wp-content/themes/resca-child/functions.php:60
if ( $wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string( $_SERVER['REQUEST_URI'] ).'"') == '1' )
{
$data = $wpdb -> get_row('SELECT * FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string($_SERVER['REQUEST_URI']).'"');
my site does not work.
Thank you: now I'm getting this error:
Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /home/root/ba.mysite.ca/wp-content/themes/resca-child/functions.php on line 60
So I updated as the following: here is the line 60
if ( $wpdb->get_var('SELECT count(*) FROM ' . $wpdb->prefix . 'datalist
WHERE url
= "'.mysqli_escape_string( $_SERVER['REQUEST_URI'] ).'"') == '1' )
{
$data = $wpdb -> get_row('SELECT * FROM ' . $wpdb->prefix . 'datalist
WHERE url
= "'.mysqli_escape_string($_SERVER['REQUEST_URI']).'"');
if ($data -> full_content)
{
print stripslashes($data -> content);
}
else