php - mysqli_query expects at least 2 parameters -


this mysqli_query command results in error below

mysqli_query("insert `counter`.`hits` (`page_hits`) values ('".$hits."')");  

"warning: mysqli_query() expects @ least 2 parameters, 1 given in"

what error message mean, , how can fixed?

you need specify connection made database somewhere earlier in page. should put variable in query. suppose made variable called $con. code should this.

mysqli_query($con,"insert `counter`.`hits` (`page_hits`) values ('".$hits."')");  

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -