I'm trying for days now to catogorize my videos on a browsepage, but when i try. One sql gives results and the other one says it has 0 results.
<?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();
?>
I hope someone knows what the problem is.
ini_set('display_errors', 1); ini_set('log_errors',1); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);to the top of your script. This will force any mysqli_ errors to generate an Exception that you can see on the browser and other errors will also be visible on your browser.