sanchez77 Posted May 17, 2009 Share Posted May 17, 2009 Ok, So I have an HTML form that submits data to a table. Here is the form: <form method=post action="submit.php"> <div align="center"> Your Name: <input name="name" type="text" size="45" /> <br /> <input type="submit" value="Post Info" /> </div> </form> It uses this PHP script to post the field to the table: <?php mysql_select_db("my_db", $con);$sql="INSERT INTO people name) VALUES ('$_POST[name]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "<center>Thanks</center>";mysql_close($con) ?> I have another table called phone and I want to query that table phone when I submit the form and take the last row field value and insert it into the people table. How do you do that? Link to comment https://forums.phpfreaks.com/topic/158490-solved-mysql-html-form-php/ Share on other sites More sharing options...
sanchez77 Posted May 17, 2009 Author Share Posted May 17, 2009 figured it out, thanks for your help Link to comment https://forums.phpfreaks.com/topic/158490-solved-mysql-html-form-php/#findComment-835954 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.