"how do i solve this error? deprecated: mysql_escape_string(): this function is deprecated; use mysql_real_escape_string() instead [closed]" Code Answer

2

the error message clearly said it .

change this

 else return mysql_escape_string($source); // you are using mysql here

to

 else return mysqli_real_escape_string($source); //will be mysqli

obs: you should switch to pdo or mysqli as mysql mysql_real_escape_string will also be deprecated :)

you are mixing between mysqli and mysql .

edit: from your second error.

  mysqli_real_escape_string ($link ,$source )  // $link is your connection variable

ref

By andy boot on January 4 2022

Answers related to “how do i solve this error? deprecated: mysql_escape_string(): this function is deprecated; use mysql_real_escape_string() instead [closed]”

Only authorized users can answer the Search term. Please sign in first, or register a free account.