delete from multiple tables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

delete from multiple tables

Post by aceconcepts »

Hi,

I'm trying to delete from two tables using:

Code: Select all

$query=mysql_query("DELETE FROM product_order WHERE order_id='$id'");

		$query=mysql_query("DELETE FROM order_details WHERE order_num='$id'");
But it's not working and no error is displayed!

$id is the product_id passed through the url (successfully).

What can i do?
User avatar
waradmin
Forum Contributor
Posts: 240
Joined: Fri Nov 04, 2005 2:57 pm

Post by waradmin »

Shouldnt $id be $_GET['id'], and do you need $query? cant you just do

Code: Select all

mysql_query("DELETE FROM whatever WHERE something=$id");
Post Reply