user342391
user342391

Reputation: 7827

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)."', 
                                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)."'
                    ");

Upvotes: 0

Views: 1785

Answers (2)

MightyE
MightyE

Reputation: 2679

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.

Upvotes: 1

VolkerK
VolkerK

Reputation: 96159

Not mysql_real_escape() but mysql_real_escape_string()

Upvotes: 4

Related Questions