php - Mysqli statement returning warnings -


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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -