Hey guys!
Is there a way to use prepare statement for the following line of codes?
function mss($value) {
return mysqli_real_escape_string(trim(strip_tags($value)));
}
Hey guys!
Is there a way to use prepare statement for the following line of codes?
function mss($value) {
return mysqli_real_escape_string(trim(strip_tags($value)));
}
I have the following error… mysqli requires 2 parameters but when I add my database connection $conn, it still says undefined variable $conn… How can i do this without using a function?
That’s not a prepared statement, but you can fix the error by adding the $connection value to mysqli_real_escape_string
Because by definition, here is how to use it
mysqli_real_escape_string($conn, $value);
I did that but still got an error…
What variable are you using to connect?
$… = mysqli_connect…
my database connection name is $conn but I have an undefined variable error of $conn
Try
function mss($conn, $value) {
return mysqli_real_escape_string($conn, trim(strip_tags($value)));
}
And when you want to use the function:
mss($conn, $value);
What does this do anyway? Is it important to do this if I am using prepared statement?
If you are using prepared statements, this is useless