multiple inserts

From: Date: Mon, 14 Aug 2000 01:12:40 +0000
Subject: multiple inserts
Groups: php.db 
Request: Send a blank email to php-db+get-2018@lists.php.net to get a copy of this message
I am trying to insert information from a form into multiple tables of a database. The HTML Form is composed of two tables with multiple input fields in each. I want data from Table 1 in the HTML form to INSERT into table '1' of the database and information from Table 2 of the HTMl form to INSERT into table '2' of the database. How can I, if I can, accomplish this. Please don't tell me to RTFM, If you can find a link in the manual that explains this then please let me know, I can't. I have tried the following $var= "INSERT INTO kayak (length,type,year) VALUES ('$length','$type','$year'), paddle (lengthp, offset) VALUES ('$lengthp','$offset')"; $result = mysql_query($var); no luck. I can get it to insert into the first table, kayak, but not the second. Do I need to break this up into two commands (if so how)? newbie here so any/all help is greatly appreciated. TIA, /frank

« previous php.db (#2018) next »