PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am having a hard time with my modify script using checkboxs. What I am trying to do is have checkboxs checked for the services the user already has, and list the rest of the unchecked boxes so they can be checked and unchecked if needed. Now I can get it display just fine with the already checked boxes, only problem is it repeats the remaining list as many times as the services that are checked. I know that my while and do loop is probably screwed up somewhere.. But after looking at it for a while.. I can not figure out where...
I think it's that there are 3 loops nested, repeating the same query over and over.
The code's very confusing. Line 21 could easily create an infinite loop. Try storing off the results from the query on line 4, then passing over them all to see if the current value is checked. Once that's all done, then print out the checkbox, instead of each pass over it.
I do not quite follow what you are saying. When you say store the results from query line 4, I will assume you mean in a array. I am a bit confused on how to pass over the checked and not checked boxes, since the table has a 1 or 0 defining whether the box is checked.
Noob - Your suggestion did not work. Since reversing it would be executing the query before the query is defined.