Hi Guys,
How are we all doing this fine day 🙂
small problem "man do i hate joins"
I have two tables "categories" and "links"
Links carry the cid field from categories.
$db->query("
DELETE
FROM categories
WHERE cid = " . intval($_POST['items'][$i])
);
$db->query("
DELETE
FROM links
WHERE cid = " . intval($_POST['items'][$i])
);
Instead of runing two queries id like to be able to do the delete in one query using a join BUT MUST take into consideration that if theres no links with the cid value still delete the catergory.
I tried a few joins and could get it to delete the category and the links but as soon as there were no links for that catergory it wouldnt let me delete the catergory.
Any help appreciated.
Thanks