DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   plz..i need a help.. (http://www.daniweb.com/forums/thread101131.html)

dbayo Dec 14th, 2007 12:01 pm
plz..i need a help..
 
ello..im a new beginner for pHp script..i have to complete my final project..i used php as my programming language..but,i have a problem rite now..did anybody know,how to insert data from 1 form into multiple tables in MySql Database?..

ok,rite now,i have 2 tables, Client and Client2,k..And from 1 form that i created ,i want to add the information from the form into table Client and Client2..anybody Know?...plz help me..;(

buddylee17 Dec 14th, 2007 1:46 pm
Re: plz..i need a help..
 
Assuming you already know how to connect to the database and that your form method was post:
$name=$_POST['name'];
$age=$_POST['age'];
$sql="INSERT INTO Client (name,age) VALUES ('$name','$age')";
$result=mysql_query($sql) or die(mysql_error());
$sql="INSERT INTO Client2 (name,age) VALUES ('$name','$age')";
$result=mysql_query($sql) or die(mysql_error());

dbayo Dec 15th, 2007 1:29 am
Re: plz..i need a help..
 
Thanx u buddy..;)..i try my bes..tq..


All times are GMT -4. The time now is 8:19 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC