Arrays - need to associate value in one with value in another for db insertion
Posted on 2007-11-29
Hi - I've got a form that is generated from db data and returns two separate arrays -
(arrID) Array (  => 208  => 210  => 222  => 225  => 236 )
(arrStatus) Array (  => 2  => 3  => 3  => 4  => 1 )
I need to combine or otherwise associate the data in the arrays so that I can properly update the db. For example, I need to do a query similar to:
update table set status = $arrStatus where ID = $arrID
but I want do be able to do this in a foreach statement, as the number of items returned can differ each time the form is submitted.