Im trying to run a MySQL query, but for some reason its not working.
我试图运行MySQL查询,但由于某种原因它无法正常工作。
This is the query im running:
这是运行的查询:
SELECT * FROM applications WHERE status = 0
And my database looks like this: http://gyazo.com/cc0bfa109e73a771d99a22b5051ee2de
我的数据库看起来像这样:http://gyazo.com/cc0bfa109e73a771d99a22b5051ee2de
However, num_rows() returns 0 rows...
但是,num_rows()返回0行...
No errors are displayed...
没有显示错误......
2 个解决方案
#1
0
Try below code hope it will help you because i have tested in localhost.
尝试下面的代码希望它会帮助你,因为我已经在localhost测试过。
$sql = "SELECT * FROM applications WHERE status = 0";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo $row['mcUser'];
}
IF its not work's check your table name again.
如果它不工作再次检查你的表名。
#2
0
replace the query with single quotes between 0 $sql = "SELECT * FROM applications WHERE status = '0'";
用0 $ sql =“SELECT * FROM applications WHERE status ='0'”之间的单引号替换查询;
#1
0
Try below code hope it will help you because i have tested in localhost.
尝试下面的代码希望它会帮助你,因为我已经在localhost测试过。
$sql = "SELECT * FROM applications WHERE status = 0";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo $row['mcUser'];
}
IF its not work's check your table name again.
如果它不工作再次检查你的表名。
#2
0
replace the query with single quotes between 0 $sql = "SELECT * FROM applications WHERE status = '0'";
用0 $ sql =“SELECT * FROM applications WHERE status ='0'”之间的单引号替换查询;