DELETE products.*, product_options.*, price_options.* FROM products, product_options, price_options WHERE price_options.ProductID = products.ProductID AND product_options.ProductID = products.ProductID AND products.ProductID = '%s'
thing is it doesnt even delete the row from the main table.
Can i delete from more than one table in a single query?
kendall wrote:
I havent tried it yet but i am going to but can someone explain why i need to have the tables in alias to delete related rows in the tables
Ok Wierd....your explanation was a bit unclear but i am experimenting with the left join (argh! these left joins) but note that i am trying to delete related information from more than 2 tables. I dont understand
categories.id where categories.id is null
how does the categories is null fit in to all of this as i am trying to delete only related data?
DELETE FROM products, price_options, product_options USING products, price_options, product_options WHERE product_options.ProductID = products.ProductID AND price_options.ProductID = products.ProductID AND products.ProductID = 'test'