Easy Form problem

From: Date: Thu, 19 Apr 2001 13:37:09 +0000
Subject: Easy Form problem
Groups: php.general 
Request: Send a blank email to php-general+get-49363@lists.php.net to get a copy of this message
I am trying to update two tables at once from a form using two Insert statements: Should I be using two different variable names for $query? Only one table updates when I use the same name like this. 2 different variable names give me an error. $query = "INSERT INTO $table1 VALUES ('$menu_id', '$server', '$menunumber', '$menuname')"; $query = "INSERT INTO $table2 VALUES('$submenuid','$submenu','$subrefmenu', '$submreflink')"; $result = mysql_db_query($dbname, $query); I use one form using one submit button: <form enctype="multipart/form-data" method="post" action="<?php echo $PHP_SELF ?>"> <INPUT type="submit" name="submit" value="submit"> <INPUT type=reset value="Reset">  // Display Results if there are results if ($result) { MySQL error 0: menu_id: NULL -- This email was sent using w3mail.

« previous php.general (#49363) next »