0

Possible Duplicate:
Mysql insert into 2 tables

is it possible to make this?

e.g. INSERT INTO tableA,tableB VALUES (sharedVal, valA) (sharedVal, valB)

Community
  • 1
  • 1
user1119096
  • 103
  • 1
  • 9
  • Please search the site before asking your questions, to see if someone has already asked it. Especially for something so straightforward as this. – Jonathon Reinhart Jan 08 '12 at 17:00

2 Answers2

0

this is not posible

you can do something like :

begin transaction
 Insert into table1(col1, col2, col3 ) values v1, v2, v3;
 Insert into table2(col1, col2, col3 ) values v1, v2, v3 ;
  commit
dov.amir
  • 11,489
  • 7
  • 45
  • 51
0

You can simply

 $sql1 = "INSERT INTO tableA (shareda, vala) VALUES (sharedVal, valA)";
 $sql2 = "INSERT INTO tableB (sharedb, valb) VALUES (sharedVal, valB)";

Each time you should specify the table column, where you're putting your values.