0

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..;(

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by dbayo
0

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());
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.