View Single Post
  #2 (permalink)  
Old July 7th, 2005, 03:43 PM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I can only wonder how you're sorting through all those values.

I'd probably do a three field database table
[ id ] [ configuration/preference/directive ] [ value ]

In the form I'd do something other than service[] to keep track of all of the fields.
service[licenced]
service[bonded]
service[property_management]
...etc.

Then something like this:

Code:
foreach ($_POST['service'] as $directive => $value)
{
    mysql_query("INSERT INTO `service_vars` VALUES($id, '{$directive}', ". (int) $value .")");
}
Where $id is the user_id, or whatever other id your're attaching this information to.

I'd use a tinyint field for value, if nothing more than 0 || 1 will be the value.

Just my $0.02

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply With Quote