Re: Best way to reinstate radio-button states from database?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2009-06-28 at 21:07 -0400, Bastien Koert wrote:
> On Sun, Jun 28, 2009 at 7:12 PM, Rob Gould<gouldimg@xxxxxxx> wrote:
> > I have a webpage which allows people to log in and make selections with
> > radio buttons and hit SUBMIT and saves the data from those radio buttons to
> > a mySQL database.
> >
> > However, I'm finding that I also need the ability to allow a user to log
> > back in at a later date (or even on a different computer), and pull up that
> > survey again,
> > with each of the 50-something radio-buttons back in the positions in which
> > they were last saved.
> >
> > Surely there's a best-case-method for doing this type of thing (saving large
> > numbers of radio-button-group settings to mySQL and pulling them back
> > again later).  Any advice is greatly appreciated.  Perhaps there's a
> > jQuery-way to retrieve all the radio-button group settings as an array and
> > save it and pull it back again?
> > Or perhaps a PHP-specific method - - - I'm fine with either.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> I've tended to use a binary string for the values, as my radio/
> checkboxs tend to be yes / no, so I store the data in a single field
> as 010111010111100000000101010111000 using 0=no and 1=yes.
> 
> Then a quick loop through the string sets my values.
> 
> 
> -- 
> 
> Bastien
> 
> Cat, the other other white meat
> 

Or use a separate survey table to store each answer, and associate it
with the user by the index on the users table.

Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux