SHARE
Facebook X Pinterest WhatsApp

PHPBuilder: Storing Checkbox Data In Your Database

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



“Checkboxes in web forms are useful because they allow the person filling out the form to choose from a wide
range of possible choices. Specifically, it allows the user to choose some, all or none of the elements.
Although checkboxes are excellent form elements for certain tasks, there is often confusion about how to store
checkbox data correctly. This article will demonstrate how to store checkbox data in a database, in a manner
that follows good database design principles.”

In this article, I will demonstrate the method of storing checkbox data on a per user basis. Although there is useable PHP source
code included, I’m presenting this in a database design point of view. Therefore, the information here can be used with any
database and server side scripting language of choice. The main idea here is to provide you with an explanation of how to do it so
you can apply it to the sites you build. If you do want to play with the source code, you’ll need php, mysql, and a webserver.

“In this article, I will demonstrate the method of storing checkbox data on a per user basis. Although there is useable PHP source
code included, I’m presenting this in a database design point of view. Therefore, the information here can be used with any
database and server side scripting language of choice. The main idea here is to provide you with an explanation of how to do it so
you can apply it to the sites you build. If you do want to play with the source code, you’ll need php, mysql, and a webserver.”

“Consider the following situation. You are asked to create a web site that will allow unemployed web developers to post their skills
there. Potential employers can then visit this website and search for prospective employees, based on the skills they are looking
for. As an aspiring web developer yourself, you know that a web programmer with work is more desirable than one without.
Therefore, you decide to write the code for his site.”

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.