我正在编写一个简单的代码来从我的数据库中名为 Plasma 的表中获取 2 个元素。似乎连接良好,但由于未知原因,我无法选择任何数据库。
代码 :
<?php
$db = "Plasma";
$dbH = "localhost";
$dbU = "plasma";
$dbP = "plasma";
$dbCon = mysqli_connect($dbH,$dbU,$dbP,$db);
if(!dbCon){
echo "Conenction Fail";
}
mysqli_select_db($dbCon,$db);
$qry = "select Mid,Mname from ya_movies order by DOA limit 5;";
$Response = mysqli_query($dbCon,$qry);
echo mysqli_error($dbCon); ?>
输出是
No database selected