我有一个有4个表的数据库。(products,purchase,customer,user)当我尝试在products中显示所有行时,没有任何结果。但是在user表中,它会显示出来。应该是什么问题呢?它在我的数据库里吗?表?还是php代码?
下面是我的代码:
<?php
$db = mysqli_connect("localhost","root","", "prodpurchase");
if (!$db) {
die('Could not connect: ' . mysqli_error());
}
$sql = mysqli_query($db, "select * from user");
if( $sql === FALSE ) {
die('Query failed returning error: '. mysqli_error());
} else {
while($row=mysqli_fetch_array($sql))
{
echo $row['username']. "<br>";
}
}
?>希望你能帮我。
发布于 2013-03-25 12:34:20
您是否检查了表列中的字母大小写?
https://stackoverflow.com/questions/15607509
复制相似问题