PHP MySQL - Error: No Database selected

前端 未结 6 1037
傲寒
傲寒 2020-12-22 14:23

I am trying to read and write to a database. Here is the code I have so far:

$mysql = mysqli_connect(\"example.com\", \"johndoe\", \"abc123\"); // replace wi         


        
6条回答
  •  渐次进展
    2020-12-22 14:29

    Please check syntax of mysqli, it takes 4 parameters.You also have to provide database name.

    $link = mysqli_connect("myhost","myuser","mypassw","my_db");
    

提交回复
热议问题