The query executes .. but let's say for example the user changed the value of $_GET['sub'] to get an id which is not in the database , lets say for example : 60 . it should print "NOT FOUND" instead it prints found ! Why is that ?
$main = new MainClass();
$subid = mysqli_real_escape_string($main->MsqlConRes,$_GET['sub']);
if (is_numeric($subid))
{
$main->query = mysqli_query($main->MsqlConRes,"SELECT * FROM subjects WHERE id = ".$subid."") or die(mysqli_error());
if ($main->query)
{
echo'Found';
}
else
echo'Not Found !';
}
else
$main->errors(404);