RE: [PHP] update mysql using radio button
| From: | Matt Newell | Date: | Tue, 01 Jun 2004 20:36:41 +0000 |
| Subject: | RE: [PHP] update mysql using radio button | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-187405@lists.php.net to get a copy of this message | ||
how embarrassing. :] yes, of course that would be the problem.
just to note, i'm enjoying learning php/mysql and appreciate the help
from this list. it's a great community and the good will makes it a
great place to ask the sometimes really stupid questions.
best,
m.
-----Original Message-----
From: Daniel Clark [mailto:dclark@nwlink.com]
Sent: Tuesday, June 01, 2004 1:14 PM
To: Matt Newell
Cc: php-general@lists.php.net
Subject: Re: [PHP] update mysql using radio button
I think you need Values for the radio buttons.
<input type="radio" name="club_member" Value="N" <?php
if($row->club_member ='N'){echo 'CHECKED';}?>>
>
> hello all -
>
> i'm having a problem getting an UPDATE to work with radio buttons and
> i'm not sure where it's gone wrong. the initial values are being
> grabbed properly, but unfortunately they don't want to get updated.
> the regular text form values update just fine. would appreciate some
help.
>
> the html:
>
> <input type=hidden name="id" value="<?php echo $id ?>">
>
> club member?<br>
> No: <input type="radio" name="club_member" <?php
> if($row->club_member
> ='N'){echo 'CHECKED';}?>><br>
> Yes: <input type="radio" name="club_member" <?php
> if($row->club_member
> == 'Y'){echo 'CHECKED';}?>>
>
>
> the query to update:
>
> $query = "UPDATE outdoor SET name='$name', email='$email',
> zip='$zip',
> club_member='$club_member' WHERE id='$id'"; $result =
> mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
>
>
> [trying to keep the code paste to what i think is important, let me
> know if more is needed for info.]
>
>
> thanks!
> m.
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>