php - Is it possible to insert data in two different table using single mysql query without transaction? -


i know possible using transaction want using single mysql query.

this common format transaction

start transaction; select @a:=sum(salary) table1 type=1; update table2 set summary=@a type=1; commit; 

but need know single mysql query possible?

you can't this. however, can use transaction , have both of them contained within 1 transaction.

start transaction; insert table_1 values ('1','2','3'); insert table_2 values ('one','two','three'); commit; 

see following rule


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -