Forum Moderators: coopster

Message Too Old, No Replies

Selecting Multiple Checkboxes question

         

michlcamp

1:52 am on Feb 17, 2006 (gmt 0)

10+ Year Member



This problem involves selecting multiple orders using checkboxes next to each item on a list of customer names (which was created from a MySQL query) so that the items selected can be moved to an "archived orders" table.

For simplicity's sake, let's say the list is of ten customer names.

My query results give me a page with a list of orders that have come in today, with a checkbox to select the orders I want to process and then archive.

my WHILE loop echoes this result:

[2][b]<input type=checkbox value="$order_id"> $customer_name </br>[/b][/2]

I want to select five of the ten orders, move them to a database table named "archived", then remove them from the original table.

Looking for anyone that can point me in the right direction....
Thanks in advance.
mc

jatar_k

2:00 am on Feb 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you might want to name that form element

<input type="checkbox" name="myorders[]" value="$order_id"> $customer_name </br>

now you should get an array of order_id's
then select the full rows from the old table
insert data into the new table
on success of insert, delete from old table