etdsbastar Posted August 26, 2011 Share Posted August 26, 2011 Hello there, Please have a look in the below given code: $nv1 = isset($_POST['nv1']) ? $_POST['nv1'] : '0'; $nv2 = isset($_POST['nv2']) ? $_POST['nv2'] : '0'; $nv3 = isset($_POST['nv3']) ? $_POST['nv3'] : '0'; $nv4 = isset($_POST['nv4']) ? $_POST['nv4'] : '0'; $nv5 = isset($_POST['nv5']) ? $_POST['nv5'] : '0'; $nv6 = isset($_POST['nv6']) ? $_POST['nv6'] : '0'; $resmainroad = isset($_POST['resmainroad']) ? $_POST['resmainroad'] : '0'; $indmainroad = isset($_POST['indmainroad']) ? $_POST['indmainroad'] : '0'; where n1-n6 and resmainroad and indmainroad are checkboxes, their values are not being stored in the database, everytime it is storing 0 as the value. Below given the html code: <tr> <th><input type="checkbox" name="nv1" value = "<?php echo $nv1; ?>" <?php if($nv1=='1') {echo 'checked';} else {echo 'unchecked';} ?>> </th> <th><input type="checkbox" name="nv2" value = "<?php echo $nv2; ?>" <?php if($nv2=='1') {echo 'checked';} else {echo 'unchecked';} ?>></th> <th><input type="checkbox" name="nv3" value = "<?php echo $nv3; ?>" <?php if($nv3=='1') {echo 'checked';} else {echo 'unchecked';} ?>></th> <th><input type="checkbox" name="nv4" value = "<?php echo $nv4; ?>" <?php if($nv4=='1') {echo 'checked';} else {echo 'unchecked';} ?>></th> <th><input type="checkbox" name="nv5" value = "<?php echo $nv5; ?>" <?php if($nv5=='1') {echo 'checked';} else {echo 'unchecked';} ?>></th> <th><input type="checkbox" name="nv6" value = "<?php echo $nv6; ?>" <?php if($nv6=='1') {echo 'checked';} else {echo 'unchecked';} ?>></th> </tr> <tr> <tr> <td></td> <td colspan="3"><input type="checkbox" name="resmainroad" value = "<?php echo $resmainroad; ?>" <?php if($resmainroad=='1') {echo 'checked';} else {echo 'unchecked';} ?>> D;k vkoklh; Hkou eq[; lM+d@cktk+j ij vkrk gS \</td> <td colspan="3"><input type="checkbox" name="indmainroad" value = "<?php echo $indmainroad; ?>" <?php if($indmainroad=='1') {echo 'checked';} else {echo 'unchecked';} ?>> D;k O;kolkf;d Hkou eq[; lM+d@cktk+j ij vkrk gS \</td> </tr> Please help anyone... Quote Link to comment Share on other sites More sharing options...
fenway Posted August 26, 2011 Share Posted August 26, 2011 I don't see any INSERT statements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.