Undefined function with mysql_escape
I revieving the following error when trying use mysql_real_escape() function
Fatal error: Call to undefined function mysql_real_escape() in /var/www/registration/index.php on line 169.
What is wrong???
$result = mysql_send("INSERT customers SET
user= $username,
pword= $pass1,
//line169 firstname='".mysql_real_escape($firstname)."',
lastname='".mysql_real_escape($lastname)."',
email='".mysql_real_escape($email)."',
active='No',
activecode= $activecode,
dateofbirth='".mysql_real_escape($dateofbirth)."',
gender='".mysql_real_escape($gender)."',
title='".mysql_real_escape($title)."',
occupation='".mysql_real_escape($occupation)."',
开发者_JAVA百科 address='".mysql_real_escape($address)."',
city='".mysql_real_escape($city)."',
country='".mysql_real_escape($country)."',
zip='".mysql_real_escape($zip)."',
mobile='".mysql_real_escape($mobile)."',
telephone='".mysql_real_escape($telephone)."',
fax='".mysql_real_escape($fax)."',
website='".mysql_real_escape($website)."'
");
Not mysql_real_escape() but mysql_real_escape_string()
I believe the function you're looking for mysql_real_escape_string
That said, check into PDO or mysqli and bound parameters, this is a better longer term solution.
精彩评论