brain...full...please...help...
Posted: Thu Oct 17, 2002 5:32 pm
OK, so I've probably been staring at my screen too long today, but I'm really stuck on what I hope turns out to be a simple issue. Would be very grateful for advice.
SITUATION:
1. There's a form in the script that gets some information from a MySQL database, and using a WHILE loop it creates a list of names with checkboxes next to them.
2. Checkboxes, of course, have to be individually named, they can't share a common variable name.
3. I don't know in advance what the checkbox-able items will be or how many there will be, since they are generated on the fly from an ever-changing database. Thus, the variable names for the checkboxes are also generated on the fly, using a common prefix plus the information itself (short acronyms).
4. These unknown variables are passed to a part of the script that processes them and feeds them to a database table. I want to combine these commonly-prefixed variables into one long string as a new, single variable, which is the one that gets fed into a single field in another database table.
My initial thought was that I could use EREG to look for the variables with the common prefix, toss them into an array, and Bob's Your Uncle. Here's where we get to my problem.
I don't know what input-string to feed into EREG so it can do its check! It's a Catch-22 -- I can't identify the variables to feed until I can do something like EREG, and I can't do the EREG until, well, you get the idea.
Therefore I must be going about this the wrong way entirely. I've been banging my head against the wall trying to sort out how else I might accomplish the goal, but so far all I'm shaking loose is a bunch of brain farts.
I'm not sure I've explained this very well but if anyone has any idea what I'm on about and has any useful ideas...please help!
thanks!
SITUATION:
1. There's a form in the script that gets some information from a MySQL database, and using a WHILE loop it creates a list of names with checkboxes next to them.
2. Checkboxes, of course, have to be individually named, they can't share a common variable name.
3. I don't know in advance what the checkbox-able items will be or how many there will be, since they are generated on the fly from an ever-changing database. Thus, the variable names for the checkboxes are also generated on the fly, using a common prefix plus the information itself (short acronyms).
4. These unknown variables are passed to a part of the script that processes them and feeds them to a database table. I want to combine these commonly-prefixed variables into one long string as a new, single variable, which is the one that gets fed into a single field in another database table.
My initial thought was that I could use EREG to look for the variables with the common prefix, toss them into an array, and Bob's Your Uncle. Here's where we get to my problem.
I don't know what input-string to feed into EREG so it can do its check! It's a Catch-22 -- I can't identify the variables to feed until I can do something like EREG, and I can't do the EREG until, well, you get the idea.
Therefore I must be going about this the wrong way entirely. I've been banging my head against the wall trying to sort out how else I might accomplish the goal, but so far all I'm shaking loose is a bunch of brain farts.
I'm not sure I've explained this very well but if anyone has any idea what I'm on about and has any useful ideas...please help!
thanks!