purnendu2311
04-25-2007, 06:04 AM
Hi all,
I have four check box, i want to send 1st & 4th value of the check box into database table after selecting one or more option. ie if i select the dating and Networking, the both should store into database. example: dating, Networking in table.
I am taking the four variable and using comma i am separting the variable. But problem is that once i am select the 1st and 4th option three comma is coming inbetween dating and friend option, but i want only one comma ie dating, Networking in table.
This is the code :::::::
<input type="checkbox" name="checkbox1" value="Dating" />Dating
<input type="checkbox" name="checkbox2" value="Serious Relationships" />Serious Relationships
<input type="checkbox" name="checkbox3" value="Friends" />Friends
<input type="checkbox" name="checkbox4" value="Networking" /> Networking
I am using this variable::::::::::;
$checkbox1=$_POST['checkbox1'];//varible for dating
$checkbox2=$_POST['checkbox2'];//varible for serious ralationship
$checkbox3=$_POST['checkbox3'];//varible for friends
$checkbox4=$_POST['checkbox4'];//varible for networking
$final=$checkbox1.",".$checkbox1.",".$checkbox1.",".$checkbox1;
$qry_ins="update register_dtl set gender='$gender',dob='$dob',occupation='$occupation',city='$city',country='$country',region='$region',postal_code='$postalcode',ethnicity='$ethnicity',bodytype= '$bodytype',height='$height',i_am_here_for='$final' where uname='".$_SESSION['username']."'";
$rs_ins=mysql_query($qry_ins) or die("error:". mysql_error());
Can anyone will help me it is urgent
Thanks & Regards
Ranjan
I have four check box, i want to send 1st & 4th value of the check box into database table after selecting one or more option. ie if i select the dating and Networking, the both should store into database. example: dating, Networking in table.
I am taking the four variable and using comma i am separting the variable. But problem is that once i am select the 1st and 4th option three comma is coming inbetween dating and friend option, but i want only one comma ie dating, Networking in table.
This is the code :::::::
<input type="checkbox" name="checkbox1" value="Dating" />Dating
<input type="checkbox" name="checkbox2" value="Serious Relationships" />Serious Relationships
<input type="checkbox" name="checkbox3" value="Friends" />Friends
<input type="checkbox" name="checkbox4" value="Networking" /> Networking
I am using this variable::::::::::;
$checkbox1=$_POST['checkbox1'];//varible for dating
$checkbox2=$_POST['checkbox2'];//varible for serious ralationship
$checkbox3=$_POST['checkbox3'];//varible for friends
$checkbox4=$_POST['checkbox4'];//varible for networking
$final=$checkbox1.",".$checkbox1.",".$checkbox1.",".$checkbox1;
$qry_ins="update register_dtl set gender='$gender',dob='$dob',occupation='$occupation',city='$city',country='$country',region='$region',postal_code='$postalcode',ethnicity='$ethnicity',bodytype= '$bodytype',height='$height',i_am_here_for='$final' where uname='".$_SESSION['username']."'";
$rs_ins=mysql_query($qry_ins) or die("error:". mysql_error());
Can anyone will help me it is urgent
Thanks & Regards
Ranjan