mysqli_query expects at least 2 parameters

前端 未结 5 1173
旧时难觅i
旧时难觅i 2020-11-21 06:53

This mysqli_query command results in the error below

mysqli_query("INSERT INTO `counter`.`hits` (`page_hits`) VALUES (1)"); 

5条回答
  •  春和景丽
    2020-11-21 07:34

    You need to specify the connection that you made to your database somewhere earlier in your page. You should put that variable in the query. Suppose you made a variable called $con. Then your code should be like this.

    mysqli_query($con,"INSERT INTO `counter`.`hits` (`page_hits`) VALUES (1)"); 
    

提交回复
热议问题