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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.