473,408 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to store data from a multiple check box form

I have 6 checkbox in my entryform.php. I am supposed to check more than 1 checkbox at a time. How to store multiple value in single column of database?

Latter I also retrieve value from database and EDIT the form
May 25 '10 #1
1 2400
anfetienne
424 256MB
you could use a loop that creates a string with the values seperated by commas then insert the final string into the database. when you want to retrieve you would use the explode() function to seperate the data into an array by the commas. if you have six boxes i'd use the for loop below so it counts through but you should also check if your $_POST vars are set before add them into your string as you will just make a string that might look like the one below with blanks

$string = data,,data,data,,

Expand|Select|Wrap|Line Numbers
  1. //explode
  2. $array = explode(",",$string);
  3.  
  4. //loop
  5. for($i=0;$i<7;$i++){
  6. }
  7.  
May 25 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph Freshour | last post by:
I have a function that I call to check or uncheck all checkboxes on a form - I use a 'master' checkbox to do this much like hotmail has to check all mail messages - the code works fine if I name my...
12
by: zig | last post by:
I've posted this on alt.comp.lang.coldfusion, but is predominantly a javascript problem: I have a CF query which returns several rows of records. I wanted to have a checkbox on each record of...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
35
by: mudgilgaurav | last post by:
Hi I have multiple checkboxes on my page and i want to access only the selected checkbox on the next page can any one give me the idea how to do it Thnx in advance Bye
4
by: ATDave | last post by:
So basically I'm just creating a form that I want the results e-mailed to somebody. I have everything working except for the checkmark sections that can have multiple answers. I'm a newbie when...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
16
by: manius | last post by:
Hi. How do I insert in a db multiple checkbox results? I have 11 checkboxes, so how to do it in one query? Please :P
11
by: TechnoAtif | last post by:
INSERT AND UPDATE MULTIPLE CHECKBOX DATA USING PHPMYSQL OR JAVASCRIPT Hi All I want to check the multiple checkboxes update them after revisiting that page. I am taking the name as...
1
by: infernodeep | last post by:
Hi, I have a dynamically generated form, and each listing contains a checkbox named 'del'. The users checks the 'del' checkbox next to each listing they wish to delete, and click the submit...
17
by: Cuteako | last post by:
Hi To all, I'm new here in bytes, I would like to ask for your help on the database the i'm working on. Here are some details Name: ________ Covered Date:__________ # ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.