In my database the Owning table has foreign key(Ownerid) which references the Owner id.After some steps I would like to delete all the Owner who's id isn't in the Owning table. I have learnt how to delete with 'Delete' button a specific record but can't figure out how to delete more.This is my start:
$result = mysqli_query($link, "SELECT *
FROM Owner
WHERE Owner.id NOT IN (SELECT Ownerid FROM Owning )
");
while( $rowo = mysqli_fetch_array($result)):
/*TODO*/
endwhile;
$link is for the database connection