0

Hello, could you help me please? I have the code below. There is a form at form.php and sends some information (name, email, age) at insert.php where is the code below. In insert.php there is also another form for addinional information but I want data from the first form and the second one to be saved at MySQL simutaneously, as if it were one single form.

<?php

$con = mysql_connect("","","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("", $con);

$sql="INSERT INTO table (name, email, age)
VALUES
('$_POST[name]','$_POST[email]','$_POST[age]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo " 
";

mysql_close($con);
?> 

<form action="insert.php" method="post">
my form for additional info......
</form>

Thank you in advane! :)

Edited by andreas.rew

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. 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.