How to insert and update a row in two different tables?

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

Post Reply
rameshbyt
Forum Newbie
Posts: 2
Joined: Wed May 06, 2009 5:54 am

How to insert and update a row in two different tables?

Post by rameshbyt »

Dear friends,

How to insert and update a row in two different tables at a same time?

Insert a row from first table to second table, after the "status field" will update a first table at a same time. Anyone known please help me.


Regards,
R.R.Kumar
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: How to insert and update a row in two different tables?

Post by Mark Baker »

Two insert statements.... you may also want to start working with database transactions rather than simple inserts
OR
A trigger on the first table that automatically updates the second
Post Reply