Page 1 of 1

delete data from database

Posted: Thu Nov 16, 2006 1:20 am
by Dvorak
Hi,
Let's say i have two tables,

table_one;
userid,userinput,indexno

table_two;
cond,qant,amp,indexno

the indexno in table_one and table_two are the same.if i choose to delete one row of data in table_one,i want the data with the same indexno in table_two be deleted as well.
how can i achieve this?

Posted: Thu Nov 16, 2006 1:24 am
by Luke
Don't double post... there is no need for an extra thread on the same topic. This is against the rules, and this topic will surely be locked. :evil:

Posted: Thu Nov 16, 2006 1:25 am
by timvw
Consult the manual of your dbms... (Look for the section on 'foreign keys').

for mysql that would be http://dev.mysql.com/doc/refman/5.0/en/ ... aints.html.