php - Mysqli statement returning warnings -
this question has answer here:
here code:
include "db_conx.php"; $sql = mysqli_query("insert table(column) values('" . mysqli_real_escape_string($var) . "')"); if ($sql) {echo "connection successful"; } else { echo "failure"; }
it returns these errors:
warning: mysqli_real_escape_string() expects 2 parameters, 1 given warning: mysqli_query() expects @ least 2 parameters, 1 given
i tried using pdo didn't work either...
first parameter mysql connection link identifier, , second string more details, can visit link : http://in2.php.net/manual/en/mysqli.real-escape-string.php.
include "db_conx.php"; $sql = mysqli_query(pass_your_connection_identifier_here ,"insert table(column) values('" . mysqli_real_escape_string(pass_your_connection_identifier_here, $var) . "')"); if ($sql) {echo "connection successful"; } else { echo "failure"; }
Comments
Post a Comment