It does not reflect the data when I add a where
in a MySQLi query, if I remove the WHERE
the data is reflected.
<?php
$stmt = $con->prepare("SELECT id_world,hour,date_matches,local,visitor,active FROM world WHERE active=? order by id_world ASC limit 5");
$stmt->bind_param("i",$active);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows>0) {
$stmt->bind_result($id_world, $hour, $date_matches, $local, $visitor, $active);
while ($stmt->fetch()) {
echo '<li><span>'.$hour.' '.$date_matches.'</span> '.$local.' <span class="color">Vs</span> '.$visitor.'</li>';
}
} else {
}
$stmt->close();
?>
Can you explain to me why this happens, I don't understand, the active column is numeric, that is, and it has numeric values, in this case it is 1.