...

View Full Version : Moved my pages and now I get errors



Taipan
03-23-2004, 12:42 AM
Hi,

I was testing some pages I was writing on my own site and mysql database before moving it to the final site. They work fine on my site but now that I have moved it and transfer the sql over I am getting some errors.


// Function for escaping and trimming form data.
function escape_data ($data) {
global $dbc; // Need the connection.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string (trim ($data), $dbc);
} // End of function.This function is in the page with all the database connection information, mysql_connect.php

I am getting this error when my page tries to add or update to the database.

Fatal error: Call to undefined function: mysql_real_escape_string() in /home/share/website.net/www.websitei.net/public_html/mysql_connect.php on line 41

Hopefully someone can tell me why this happens.

Nightfire
03-23-2004, 12:47 AM
Have you moved to a different server? You may be using a different php version?

Taipan
03-23-2004, 12:48 AM
Yes, it has moved to a different server. As I am a newbie ... how can I work around this?

Nightfire
03-23-2004, 12:54 AM
Not sure really, might be something for you in the manual http://uk.php.net/mysql_real_escape_string
Just been thinking (yeah, it's a rare thing I do :p) maybe you could use str_replace (http://php.net/str-replace) to put a backslash infront of special characters?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum