popmotsy Posted July 13, 2009 Share Posted July 13, 2009 hi guys... I want to retrive table fields using chechkboxes,,,Here chechkbox values same as the Table fields Name. I want user select checkbox,, and selected checkbox data retrieve from database,viewd in the form of table. My code for checkbox is: <?php require_once("include/connection.php");?> <?php include("include/header.php"); ?> <?php require_once("include/top.php"); ?> <?php require_once("include/left.php"); ?> <?php require_once("include/left.php"); ?> <table border="0" width="990"> <tr> <TD> <table align="center" border="1" style="font-size:12"> <form name="frmTest" method="post" " > Select Fields To Make A Report</br></br> <input type="checkbox" id="chk1" name="answer[]" value="sbi_id" onclick="checkCheckBoxes(id);"/>Id </br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk2" name="answer_1" value="billcycle"/> Billcycle </br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk3" name="answer_2" value="prioritydelievary"/> Priority Delievary </br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk4" name="answer_3" value="sbi_barcodeno"/> Barcode1 </br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk5" name="answer_4" value="podno"/> POD No </br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk6" name="answer_5" value="recievedby"/> Recieved By</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk7" name="answer_6" value="relation"/>Relation</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk8" name="answer_7" value="remark"/> Remark</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk9" name="answer_8" value="bcode"/> Barcode2</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk10" name="answer_9" value="ldate"/>Letter date</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk11" name="answer_10" value="acno"/> Account No</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk12" name="answer_11" value="customername"/> Customername</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk13" name="answer_12" value="compname"/> CompanyName</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk14" name="answer_13" value="address"/> Address</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk15" name="answer_14" value="rphone"/> Resi Phone</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk16" name="answer_15" value="ophone"/> Office Phone</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk17" name="answer_16" value="cityid"/> City</br> <input type="checkbox" onclick="checkCheckBoxes(id);" id="chk18" name="answer_17" value="pcode"/> PinCode</br> <input type="submit" name="submit" value="submit"/> </form> Quote Link to comment https://forums.phpfreaks.com/topic/165779-retrive-data-using-checkboxex-from-database/ 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.