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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -