Delete multiple rows in multiple table using INNER JOIN in mySQL 5 TABLES

admin

Administrator
Staff member
I want to run this query, but its not working. There 5 tables to delete.

Code:
terms hav 1 row
term_taxonomy hav 1 row
term_relationships hav 1 row
post hav 5 rows
postmeta hav 5 rows

The structure follows wordpress nav_menu

I want to use that structure in my cms. Creating and retrieving done fine but I don't know why the delete statement not working...

Query returns true, but rows are still there.

Here's the query:

Code:
$query = "DELETE t, tt, tr, p, m 
FROM terms AS t
INNER JOIN term_taxonomy AS tt ON t.term_id = tt.term_id
INNER JOIN term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id
INNER JOIN post AS p ON tr.object_id = p.ID
INNER JOIN postmeta AS m ON m.object_id = p.ID
WHERE t.term_id = 1;";