mysqli_query expects at least 2 parameters

前端 未结 5 1049
旧时难觅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条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 07:28

    mysqli_query excepts 2 parameters, the first variable is mysqli_connect equivalent variable, the second one is the query you have provided

    $name1 = mysqli_connect(localhost,db_username ,db_pswd ,db_name );
    
    $name2 = mysqli_query($name1,"INSERT INTO `counter`.`hits` (`page_hits`) VALUES (1)");
    

提交回复
热议问题