Jump to content

Archived

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

missyevil

deleteing linked rows from multiple tables

Recommended Posts

Hi!

Basically I want to delete entries from 3 tables - table1, table2 and linktable.

I have something along the lines of:

[code]DELETE FROM table1, table2, linktable
WHERE linktable.id1=table1.id AND linktable.id2=table2.id[/code]

BUT, I'm getting syntax errors returned.

I'm very new to MySQL and PHP, so sorry if this is a really stupid question! Any help much appreciated.

Share this post


Link to post
Share on other sites
There are a number of ways to handle multi-table deletes -- you want want to look at the other syntax in the refman; also consider using JOINs.

Share this post


Link to post
Share on other sites

×

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.