"Jtjohnston" wrote:
> Anyone Awake? Up?
It is 6:17 pm.  I would have trouble sleeping at this time of day :)

> I'm using 12 checkboxes
>
> <INPUT TYPE="checkbox" NAME="Check1" VALUE="Your Name">
>
> dynamically generated by mysql. Each has an id as primary index so I do
> this:
>
> <INPUT TYPE=\"checkbox\" NAME=\"Check".$mydata->id."\"
> VALUE=\"".$mydata->yourname."\">
>
> When I submit, I want to echo to see if anyone clicked on them. But I
> can't get my variable right to find $check1 through $check12. How do I
> express in a for loop. $Check.$i does not work of course!

There are two ways I can think of.

1) You could change the way that your code creates the checkbox names, so
that rather than getting 12 variables, you get an array with 12 elements.

2) You could repeat your MySQL query on the echo page, and loop though code
something like this:
$varname = "Check".$mydata->id;
echo $$varname;

Good Luck.

Luke Welling.
--
PHP and MySQL Web Development
by Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to