PHP function() Error , what's the newer Function() of this

30 Views Asked by At

I used that query in PHP but it does not work

mysql_real_escape_string();

so what should i do ??

Is that is the previous version of PHP so please give me a solution of newer function . Without your answer my project is on pending .

2

There are 2 best solutions below

0
Ghanshyam Dekavadiya On
$firstname = mysqli_real_escape_string($con, $_POST['firstname']);

Try this one

0
mrJ0ul3 On

First, check your applications server version. It seems like it has been deprecated :

Check it out, you will get the answer : http://php.net/manual/en/function.mysql-real-escape-string.php