The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Gonna keep this short.
Anyone know a way of deleting a record from multiple tables?
I tried this syntax: -
DELETE * FROM auction,keyfeatures,images WHERE ID=$theID
Doesn't want to work though.
The table 'auction' uses what is in $theid as it's primary key.
The other two tables have whatever $theid is as it's secondary key
Cheers for any help.
Gonna keep this short.
Anyone know a way of deleting a record from multiple tables?
I tried this syntax: -
DELETE * FROM auction,keyfeatures,images WHERE ID=$theID
Doesn't want to work though.
The table 'auction' uses what is in $theid as it's primary key.
The other two tables have whatever $theid is as it's secondary key
Cheers for any help.
DELETE auction,keyfeatures,images FROM auction,keyfeatures,images WHERE auction.id=keyfeatures.id and keyfeatures.id=images.id and auction.id=$theID
Check the mysql docs for the exact syntax.
DELETE * FROM auction WHERE ID=$theID
DELETE * FROM keyfeatures WHERE ID=$theID
DELETE * FROM images WHERE ID=$theID
Error: Unknown column '72568bf531e97cca0a4744d5e7b00c3c' in 'where clause'
With this syntax: -
DELETE auction,keyfeatures,images FROM auction,keyfeatures,images WHERE auction.AuctionID=$theitem AND auction.AuctionID=keyfeatures.AuctionID AND keyfeatures.AuctionID=images.AuctionID
I've checked the manual and from what I can see it's all OK....
Try
> DELETE AuctionID FROM auction,keyfeatures,images
> WHERE auction.AuctionID=keyfeatures.AuctionID AND
> keyfeatures.AuctionID=images.AuctionID AND auction.AuctionID='$theitem'
I think you have to list all of the tables you wish to delete from after the "delete" keyword and the "from" one.
Cheers everyone.
(MySQL is so unpredictable at times....)