
July 3rd, 2009, 07:47 AM
|
|
Contributing User
|
|
Join Date: Feb 2008
Posts: 57
Time spent in forums: 12 h 16 m 35 sec
Reputation Power: 2
|
|
|
PHP5 - Using arrays and INSERT statements
Hi,
I have a table that lists orders from customers - I am supplying a checkbox next to each order, so that the administrator can tick multiple orders then click the submit button "Update orders" which then changes a field in the database to "yes" - to signify the order has been verfied. The checkbox code is as follows:
PHP Code:
echo '<td><input type="checkbox" name="order" value="'. $orderID .'" />
The above code is located in my "while" loop so that $orderID comes straight from the row itself.
However, I can only get my code to actually perform an UPDATE statement on one of the fields when this is submitted.
PHP Code:
UPDATE order_table SET ordered = 'yes' WHERE order_id = $orderID
I need to find a way of storying the ticked checkboxes in an array?.. and then performing the UPDATE statement on multiple rows, instead of just one.
Any help would be greatly appreciated.
|