Inseritng data values into multiple tables using same values

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
shab620
Forum Commoner
Posts: 48
Joined: Tue Jan 18, 2005 7:50 pm

Inseritng data values into multiple tables using same values

Post 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
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post 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);
Post Reply