CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Checkbox List to a single DB field

Print topic Send  topic

Author Message
Finian826

Posts: 29
Posted: 12/18/2008, 10:18 AM

Good day,
I want to take a checkbox list and enter all the values into a single DB field, either comma or semi-colon seperated. On the reverse side I want to be able to display the checked items to a form for updating.

Any help would be great. This would be a great default feature for some upcoming version.
Terry
View profile  Send private message
melvyn


Posts: 333
Posted: 12/18/2008, 2:20 PM

1) Set all fields as you normally do it. In datasource property use "CustomCode" Instead of db field.
2) Set one aditional field and link that one to your DB.
3) In BeforeInsert event use implode function (or whatever you like) to concat all those fields into a single string, separated by comma, semicolon or whatever. The purpose is take all fields and store in a single value.
4) In BeforeShow Event use explode function to separate all those fields and assing them to the custom code.

I recommend the usage of ENUM field type in the DB (I guess you're using mysql.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.