delete data from database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Dvorak
Forum Newbie
Posts: 11
Joined: Tue Nov 07, 2006 2:25 am

delete data from database

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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:
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
Post Reply