Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- update table for several records
December 27, 2005, 3:45 pm
rate this thread
I have a list of records as a result of a query. They are displayed
with a while sentence...
while($row = mysql_fetch_array($res))
at the end of each record, I inserted a checkbox because I need to
update all the records that the user checks in the checkbox. So, the
1) The PHP displays all the records with the "while"
2) The user checks one or more checkbox
3) Then Update the table where the record is checked
Each checkbox has an unique name. I understand how to update the table
with one record checked, but as the numbers of records to change can
variable, how do I do it???
Any help will be apprecciate!!
Re: update table for several records
Don't give each check box a unique name, give each check box the same
name only do it like this: name= "check" The value of the checkbox
should be the id of the record you want to change.
This will result in an array of values, $_REQUEST['check'], which you
can loop through using foreach.
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/