What does the mysqli_error() expects parameter 1 to be mysqli, null given mean?

后端 未结 4 1102
北恋
北恋 2020-11-30 13:19

I have this PHP page:



        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 13:47

    Hi please don't confuse with mysql_connect(); with mysqli_connect();

    Try to change as follows

    $conn=mysqli_connect("yourhost", "username", "password", "database-name") or die("initial host/db connection problem");`
    

    Then if its connected then pass your query with

    mysqli_query($conn, "your query string") or die ("query not executed");`
    

    Now it works fine! (mods, removed a to quer.r.y)

提交回复
热议问题