passing multiple vars?
| From: | Paulson, Joseph V. \"Jay\" | Date: | Fri, 07 Jul 2000 20:13:12 +0000 |
| Subject: | passing multiple vars? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5443@lists.php.net to get a copy of this message | ||
Hello everyone--
Okay well I have a slight problem. I have a database of books with the
fields of:
Book_ID
Title
Description
What I am trying to do is be able to delete multiple entries at the same
time. I have my SQL statement print out all the book id's and book titles
in a multiple select menu in the browser and then I press the "Delete Book"
button at the bottom of the page.
Here's the problem: how do I retireve all the book id's that I have selected
from the previous page? After I press the "Delete Book" button it only
passes one of the book id's instead of multiple id's. I really want to use
the <select><option> tags and not something like checkboxes because I don't
want hundreds of book titles printed to the screen and have the user scroll
down a huge page to check the boxes of which books he/she wants to delete.
Anyway, any ideas on how I can pass all the values that I select on to the
next page?
Here's a snippet of the form code I am using:
echo "<select name=\"bookID\" size=\"10\" multiple>\n";
for ($i=0; $i<$maxArraySize; $i++) {
echo "<option
value=\"".$book["BOOK_ID"][$i]."\">".$book["TITLE"][$i])."
</option>\n";
} //end of for
echo "</select>\n";
thanks,
jay