noobstar Posted February 9, 2007 Share Posted February 9, 2007 Hi there Sorry i wasn't sure if to post this in the PHP Help section or in here. My problem is fairly simple but i have never done it before. What im tring to do is delete records from 2 tables. Here below you can see what i got at the moment: <?php include ("connection.php"); $thread_mod = $_POST['thread_mod']; $forum_id = $_POST['forum_id']; $thread_id = $_POST['thread_id']; if ($thread_mod == 'Delete') { mysql_query("delete from forum_threads a, forum_post b where a.thread_id='$thread_id' and b.thread_id='$thread_id'"); // non working delete statement if ($results_id) { print 'Deleted thread successfully!<p />'; } else { die ("Query=$sql failed! <p />"); } echo "<form method=post action=threads.php><input type=hidden name=forum_id value=".$_POST['forum_id']."><input type=submit value=Back></form>"; } ?> Thank you for any help what so ever Link to comment https://forums.phpfreaks.com/topic/37727-solved-deleting-from-2-tables/ Share on other sites More sharing options...
noobstar Posted February 9, 2007 Author Share Posted February 9, 2007 Buh im sorry for the trouble i solved it haha I just simply did 2 mysql_query() commands one to delete from the thread table and the other to delete from the post table Hope it helps someone in the future Link to comment https://forums.phpfreaks.com/topic/37727-solved-deleting-from-2-tables/#findComment-180519 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.