Re: checkboxes
| From: | Jayme Jeffman Filho | Date: | Wed, 27 Sep 2000 15:37:13 +0000 |
| Subject: | Re: checkboxes | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3116@lists.php.net to get a copy of this message | ||
You need break the process when you'd reached a checked result, so put a
break statement after the line => $checked = 'CHECKED'; break;
Jayme.
http://www.conex.com.br/jjeffman
-----Mensagem Original-----
De: <luis@mecha.barry.edu>
Para: <php-db@lists.php.net>
Enviada em: terça-feira, 26 de setembro de 2000 19:18
Assunto: [PHP-DB] checkboxes
> Hello:
>
> I have a series of checkboxes on a form that the user can edit...anyways,
I want
> to make the boxes to be checked if the value is in a table...the code
works
> below...more or less, because it gets the first one, but not others that
may be
> in the db...I know I am close but I can't seem to get it...
>
> anyone see my stupid mistake please email me directly as I think my sub is
a
> little flaky...thanks
>
> Luis
>
> <?
> file://gets all checkboxes
> while ($allpreqs = db_fetch_array($preqz)) {
> file://gets selected checkboxes
> while ($chkdpreqs = db_fetch_array($prq))
> $checked = '';
> if ($allpreqs['preq_id'] == $chkdpreqs['preq_id']) {
> $checked = 'CHECKED';
> }
> }
> echo ("<INPUT TYPE=checkbox NAME=preq[]
> VALUE=\"".$allpreqs['preq_id']."\"
".$checked.">".$allpreqs['prereq']."<BR>\n");
>
> }
> ?>
>
> ---------------------------------------------
> This message was sent using Mecha WebMail.
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>