Re: checkboxes names & values in mySQL (newbie)

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

 



Hello, John.

You wrote 10 октября 2002 г., 23:40:10:

J> 2 questions:
J> Should  I have a unique form name for each checkbox, and store it's
J> boolean value in the database, OR (is it more streamlined) ..

J> To   create   an   array   <input   type=checkbox  name=apps  value
J> =myarray[$i]>  with  the  same  name  but  different value for each
J> checkbox.
Yes, you are right. This is a good way, to create an array.

J> Finally, how do I construct the query to store the array of values?
J> Do  I  need  a  separate  column  (enum('n','y') for each value, or
J> should I store all the true values as a long text string?
It'll be nice to store values separetly each in row.

Smth like this

INSERT INTO table (apps, value) VALUES ('apps', '$value[1]');
INSERT INTO table (apps, value) VALUES ('apps', '$value[2]');
etc.

Then, you can manupulate those values as you want.

www.pskov.ru                    webmaster|programmer|DBA
www.invest.pskov.ru
www.education.pskov.ru
-- 
Best Regards,
Andrey                          mailto:andrey@pleskov.ru



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux