my db has multiple tables with an online form that captures data to go into one or more of these tables.
i have total success with a single table db - from user entered data to mysql db record - perfecct.
now i am testing the new multi-table db using just two of the tables, and i know the variables are set correctly because i use an 'echo' statement to print them on a confirmation page.
yet, there are no records in the db.
i've got the varibles written first as:
$fieldname1 = $_POST['fieldname1'];
then, I do the;
if (isset($_POST['submit'])) {
mysql_connect("mysql.ips.com","dbuser","dbpassword");
mysql_select_db("dbname");
then, i've got the insert query written in this sequence:
$query="insert into tablename1 (field1, field2, field3)";
$query.="VALUES ('$field1','$field2','$field3');
$query="insert into tablename2 (field4, field5, field6)";
$query.="VALUES ('$field4','$field5','$field6')";
---------------------
-----------------
note that the db has been set up with all the necessary tables (12) but i am testing it in steps.
The previously mentioned 'successful' test was with a test db that had only one table.
So I think there is some clever little mysql something that has to play here, and hoping there is a clever somebody here that can steer me in the right direction!
Many thanks!
yamy
i have total success with a single table db - from user entered data to mysql db record - perfecct.
now i am testing the new multi-table db using just two of the tables, and i know the variables are set correctly because i use an 'echo' statement to print them on a confirmation page.
yet, there are no records in the db.
i've got the varibles written first as:
$fieldname1 = $_POST['fieldname1'];
then, I do the;
if (isset($_POST['submit'])) {
mysql_connect("mysql.ips.com","dbuser","dbpassword");
mysql_select_db("dbname");
then, i've got the insert query written in this sequence:
$query="insert into tablename1 (field1, field2, field3)";
$query.="VALUES ('$field1','$field2','$field3');
$query="insert into tablename2 (field4, field5, field6)";
$query.="VALUES ('$field4','$field5','$field6')";
---------------------
-----------------
note that the db has been set up with all the necessary tables (12) but i am testing it in steps.
The previously mentioned 'successful' test was with a test db that had only one table.
So I think there is some clever little mysql something that has to play here, and hoping there is a clever somebody here that can steer me in the right direction!
Many thanks!
yamy