I am new to php and coding for mysql. I am upgrading php code which used deprecated mysql_
code to mysqli_
. I cannot get the format for this function converted to mysqli_
correctly. This code is in a functions.php code which is included by most of the other php code.
function tep_db_input($string) {
return mysql_escape_string($string);
}
I attempted to code as follows:
function tep_db_input($string) {
return mysqli_escape_string($con, $string);
}
$con
is my database connection. The error that I receive is:
Warning: mysqli_escape_string() expects exactly 2 parameters, 1 given in /home4/reinvest/public_html/members/includes/functions.php on line 7
Since I do have 2 parameters in the mysqli_escape_string()
, I am lost as to what the issue is?