maxat
07-21-06, 04:50 AM
Hi, I am new in mysql and having problem with deleting rows from multiple tables.
I have 3 tables
1. table users
us_id <- primary key
2. table items
od_id <- primary key
pd_id <- primary key
us_id <- primary key
it_qty
3.table orders
od_id <- primary key
In table "items" all are foreign keys from another tables except it_qty.
The problem is when I delete user from table "user", I want delete all his records from "items" and "order" tables. My tables are in MyIsam. so far I couldn't get any valid query.
Please help me with this query. Thanks in advance.
I have 3 tables
1. table users
us_id <- primary key
2. table items
od_id <- primary key
pd_id <- primary key
us_id <- primary key
it_qty
3.table orders
od_id <- primary key
In table "items" all are foreign keys from another tables except it_qty.
The problem is when I delete user from table "user", I want delete all his records from "items" and "order" tables. My tables are in MyIsam. so far I couldn't get any valid query.
Please help me with this query. Thanks in advance.