You need to run the mysql_db_query() twice. Once for each statement, and between the
assignments:
$query = ...;
$mysql_db_query(...);
$query = ...;
$mysql_db_query(...);
> 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
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]