Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in

后端 未结 3 1830
时光取名叫无心
时光取名叫无心 2020-12-22 14:23

im a beginner and also a diploma student... i have created database using localhost... im having problem viewing my database... please help me... i hope u can help me with a

3条回答
  •  情话喂你
    2020-12-22 15:04

    If you check the php manual here: http://php.net/manual/fr/mysqli.select-db.php

    You will see the function mysqli_select_db take two params in input.

    bool mysqli_select_db ( mysqli $link , string $dbname )

    So you should have

    // Connect to server and select databse.
    $conn = mysqli_connect($host, $username, $password) or die("cannot connect"); 
    mysqli_select_db($conn, $db_name) or die("cannot select DB");
    

提交回复
热议问题