dcsimg

PHPBuilder: Storing Checkbox Data In Your Database

By ServerWatch Staff (Send Email)
Posted Oct 20, 2000


"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."

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.