Jump to content

[SOLVED] deleting from 2 tables


noobstar

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.