Find MYSQL Errors

Find MYSQL Errors

To locate mysql errors, you can use the code below after you run a query. Then, load the page in the browser and locate the error.

print ("Query: ".$command." Error Message: ".mysqli_error($db));

Full Code:

$command = "SELECT firstname, lastname, height, weight FROM table_sort WHERE height<>'' AND weight<>'' ";
$result = mysqli_query($db, $command);
print ("Query: ".$command." Error Message: ".mysqli_error($db));