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

Recommended Answers

All 2 Replies

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

Thanx u buddy..;)..i try my bes..tq..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.