Question

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)."'
                    ");
Was it helpful?

Solution

Not mysql_real_escape() but mysql_real_escape_string()

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top