views:

11

answers:

0

Imagine there are table in the page with info that few people have sent in. Someone else has to updete that info selecting an option from select menu. It selecst one option from teh list for each row and then updates info by pressing submit button. How can I update multiple entries in database with one click? It easy to do with checkboxes in foreach loop like:

<input type="checkbox" name="item[] value="$id" />

            if (count(@$_POST['smth']) > 0)
            {
                    foreach($_POST['smth'] as $id)
                    {
                        mysql_query ('Update...WHERE id = $id');
                    }               
            }