delete data from database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
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 »

DUDE! ONE POST! NOT THREE... be patient... posting more threads on the same topic will not make people answer you faster, in fact it's likely that people will be annoyed and not answer at all.
User avatar
Dvorak
Forum Newbie
Posts: 11
Joined: Tue Nov 07, 2006 2:25 am

Post by Dvorak »

Oh,that's a mistake man..just ignore it then.. :lol:
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Re: delete data from database

Post by aaronhall »

Dvorak wrote: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?
Won't two different delete queries delete two different records?
Locked