mum4d Posted April 18, 2006 Share Posted April 18, 2006 Is it posable to update/insert into 2 database tables (with the same information) at the same time. I want one table to be used as a "shopping basket" and the other as "stock control" so I need the same data in each but when the shopping basket is emptied by the user the data remains in a second table for stock control.Thanks in advance Link to comment https://forums.phpfreaks.com/topic/7744-update-2-database-tables-at-the-same-time/ Share on other sites More sharing options...
shocker-z Posted April 18, 2006 Share Posted April 18, 2006 yeah it isUPDATE table1,table2 SET table1.field = 'value', table2.field = 'value'and i think this second one for inert is correct..INSERT INTO table1, table2 (table1.field1,table1.field2,table2.field1,table2.field2) VALUES('table 1 value1','table 1 value2',' table 2 value3','table 2 value4')I'm not 100% on the insert as i have not found anything on inserting into 2 tables in 1 query i would personaly use 2 seperate querys to insert same data.. Link to comment https://forums.phpfreaks.com/topic/7744-update-2-database-tables-at-the-same-time/#findComment-28247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.