473,467 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

checkbox answers

2 New Member
hya i have added a select box group for my members interests in the line of something like


item1
item2
item3
item4

and if someone was to tick 2, 3 and 4 i want all 3 selections to show in database where as at the moment only the last one selected is showing in table

ive wrapped the name in [] as said in other posts but when i check selection in database all i get is array after submitting form again

what can i do to achieve this ty in advance kevin
Sep 9 '14 #1
2 1245
mukherjee
9 New Member
You need to add multiple records in database or save the choices in colon separated form like(item1:item2) ,etc.
Sep 10 '14 #2
testingkp
2 New Member
i am lost just gone into database went to change multiple_interests table by attempting to change it to userdefined and add options to choose and i get query error msg here the coding that i have so far

Expand|Select|Wrap|Line Numbers
  1. $insert = mysql_query("update user_info set postalcode = '".$_POST['postalcode']."' , 
  2.     city             = '".$_POST['city']."' , 
  3.     seeking         = '".$_POST['seeking']."' , 
  4.     height             = '".$_POST['height']."' , 
  5.     lookingfor         = '".$_POST['lookingfor']."' , 
  6.     hair             = '".$_POST['hair']."' , 
  7.     bodytype         = '".$_POST['bodytype']."' , 
  8.     havecar         = '".$_POST['owncar']."' , 
  9.     education         = '".$_POST['education']."' , 
  10.     eyecolor         = '".$_POST['eyecolor']."' , 
  11.     union_territory = '".$unionterritory."' , 
  12.     smoke             = '".$_POST['dosmoke']."' , 
  13.     drink             = '".$_POST['dodrink']."' , 
  14.     wantdate_smokes = '".$_POST['datesmokers']."' , 
  15.     talking_about     = '".$talk_about."' , 
  16.     multiple_Interests = '".$_POST['multiple_Interests']."' , 
  17.     headline         = '".$headline."' where user_id = '".$_SESSION['last_id']."' ") or die(mysql_error());
Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.     <td><input name="multiple_Interests" type="checkbox" value="option1" /><label for="option1">option1</label></td>
  3.     <td><input name="multiple_Interests" type="checkbox" value="option2" /><label for="option2">option2</label></td>
  4.     <td><input name="multiple_Interests" type="checkbox"value="option3" /><label for="option3">option3</td>
  5.   </tr>
  6.  
Sep 10 '14 #3

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

Similar topics

34
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
0
by: sukaina | last post by:
hello i want to update some records in the database by using checkboxes. I wrote a code but it didn't work proparly. It update whole records not only the selected one by the checkbox. how can i...
6
by: yash777 | last post by:
hello all, this is my first post on the site. I just want to Know the javascript which is used to disable the checkboxes on click of another checkbox? means if we click on checkbox, the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.