Page 1 of 1

Inseritng data values into multiple tables using same values

Posted: Thu Feb 03, 2005 12:33 pm
by shab620
Hye
I'm new to php
I was wondering if it is possible to perform two queries in one php script. I.e taking values from a form and then inserting that value into one table but after that inserting into another using the same values in the variables?

Hope some one can help
:D :D
Shab

Posted: Thu Feb 03, 2005 12:44 pm
by anjanesh

Code: Select all

$sql1="INSERT INTO `table1` ' ".$_POSTї'PostData1']." ' ";
$sql2="INSERT INTO `table2` ' ".$_POSTї'PostData1']." ' ";
$res1=mysql_query($sql1);
$res2=mysql_query($sql2);