I am trying to delete a row from my database. When I execute my PHP script I am getting the error message:
Notice: Trying to get property 'num_rows' of non-object in /home/send.php on line 46
.
Does someone know what is wrong with my script?
Line 46 = if ($result10->num_rows > 0) {
Here is the PHP script which I am using to delete the row:
$link10 = mysqli_connect("localhost", "root", "password", "database");
if($link10 === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$sql10 = "DELETE FROM statement WHERE id = '". $_SESSION['id'] ."' AND number = '". $_GET['number'] ."'";
$res10 = mysqli_query($link10, $sql10) ;
$result10 = $link10->query($sql10);
if ($result10->num_rows > 0) {
//script
}