Jump to content

dynamic varialbes


arisecc

Recommended Posts

not sure if this is the correct way of doing this, but i'd like to be able to do something with a php page receiving a forum such as:

for ($ii;$ii<50;$ii++) {
    if (answer_$ii!="") {
        ///do something
    }
}


for example, it will loop through variables from $answer_1 to $answer_50. There's probably a much better way of doing this, I have a database of questions being added to a page dynamically (numbered 1 through 50) and I want to check through each if they have been answered. The answers are in radiobox or checkbox form, such as:

...
$linehere=mysql_fetch_array($r);
<input type=\"radio\" class=\"checkbox\" name=\"".$linehere['id']."\" value=\"a\" />


Hope this makes sense, any help would be great. Thanks
Link to comment
https://forums.phpfreaks.com/topic/29206-dynamic-varialbes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.