Solved: php mysql update corresponding records

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

twmprys

Thread Starter
Joined
Jun 4, 2009
Messages
111
Hope somebody can help. I've spent ages trying to work out how FOR or FOREACH could help in this, but I can't figure out the exact process. I have a form which includes a WHILE loop listing members from a database with checkboxes. When the form is SUBMITTED I want those members with checked boxes to be recorded as such.

These are the two fields being POSTED:

PHP:
$_POST['seniormember'];
$_POST['id'];
The 'seniormember' is the checkbox. The idea is those who have been CHECKED become senior members.
Could somebody nudge me in the right direction?
 

twmprys

Thread Starter
Joined
Jun 4, 2009
Messages
111
Thanks. Combining that simple lesson with FOREACH half solved my problem. I can get the database to record new checks. Now I have to work out how to cancel unchecked rows.
 

twmprys

Thread Starter
Joined
Jun 4, 2009
Messages
111
My complete solution is this: run a query through the database clearing all the checked fields, then run a FOREACH loop to populate just the fields that need to be checked. A bit brutal, but it works.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top