Re[4]: [PHP] checkbox
| From: | Richard Kurth | Date: | Sat, 25 Nov 2000 22:10:25 +0000 |
| Subject: | Re[4]: [PHP] checkbox | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27187@lists.php.net to get a copy of this message | ||
Hello Folke,
I realize what I am doing wrong the form that puts the data in the
database looks like this for the checkbox
<input type="radio" name="Frontpage" value="YES">YES
<input type="radio" name="Frontpage" value="NO" checked>NO
The form for updating the database would look somthing like this
<input type="radio" name="Frontpage" value="<?php echo
$row["frontpage"] ?>">
Now my question is how do I pull the yes or no from the database and
show it in the form.
FA> Hi Richard,
FA> i can't write the if condition for because i don't know what
FA> you expect in the mySQL-field for an checked checkbox and what for an
FA> unchecked.
FA> for example :
FA> <?php if ($row[frontpage]=="Y") print " checked"?>
FA> ok?
FA> regards
FA> Folke
--
Best regards,
Richard mailto:rkurth@pacifier.com