insert array values
| From: | PJ | Date: | Fri, 06 Mar 2009 21:00:06 +0000 |
| Subject: | insert array values | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-289487@lists.php.net to get a copy of this message | ||
I've been racking my little peanut-brain as well as big Google with
little hope...
I can retrieve the array from the multiple select dropdown box but I
can't quite manage to insert the data which is just id numbers for a table.
I've tried some while stuff but doesn't work. I know I don't have the
right syntax on anything at this point. Here's an effort that doesn' work.
Dont know if I should be using $categoriesIN[] type of stuff...
but my tries were from web illustrations...
the outcommented line returns the values of the array... but how to pass
them to the query?
foreach ($categoriesIN as $category) {
//"$category<br>";
$sql = "INSERT INTO book_categories ( book_id, category )
VALUES( book.id WHERE title = $titleIN, $category )";
$result = mysql_query($query, $db);;
}
TIA
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- pj@ptahhotep.com
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php