我现在正在尝试几天以在浏览页面上分类我的视频,但是当我尝试时。一个sql给出结果,另一个sql给出0个结果。
<?php
include("db-conct.php");
$cato = "SELECT * FROM movies WHERE `cato` = 'cato' ORDER BY views DESC";
$result = $conn->query($cato);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
}
}else{
echo "0 results";
}
$conn->close();
?>
<?php
$cato1 = "SELECT * FROM movies WHERE `cato` = 'cato' ORDER BY views DESC";
$result = $conn->query($cato1);
if ($result->num_rows > 0) {
// output data of each row
while($row1 = $result->fetch_assoc()) {
}
}else{
echo "0 results";
}
$conn->close();
?>
我希望有人知道问题所在。
答案 0 :(得分:2)