473,734 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating multiple checkbox entries into php mysql database

63 New Member
Hi All..'mAtif..i' ve got stuck within checkboxes these days..i've got many input items like checkboxes,text area and along with them there are many checkboxes...al l the data except the checkbox's is comfortably getting entered into the database but the real problem is with the checkboxes..onl y one entry is being stored ...but i want to enter the multiple entries from the checkboxes to enter into the database...the form is a voting poll..and i have made use of arrays..but i'm not able to get the right way of how to enter the multiple checkbox entries into mysql..plz help..the code follows...It has two tables...the updata checkbox data is to be entered into the 'tally' table... .More than one votes can be dne through checkboxes and as they are checked,there entry should be made into the table..plz help.as quick as possible..thanx in advance...the code follows:

Expand|Select|Wrap|Line Numbers
  1. [PHP]<?php
  2.  include "dbconnect.php";
  3.  include "commonFunc.php";  ?>
  4.  <!---------------------------------->
  5.  
  6.  
  7.  
  8. <table width="80%" border="1" cellpadding="2" cellspacing="0">
  9. <tr > 
  10. <td colspan="2"><p>
  11.   <?php
  12.  
  13. //mysql_connect("localhost", "awards_archi", "123456") or die(mysql_error()); 
  14. //mysql_select_db("awards_archi") or die(mysql_error()); 
  15. $cookie = "voted"; 
  16. $mode=0;
  17. //$vote=0;
  18. //This runs if it is in voted mode 
  19. if ( $mode=="voted") 
  20. //makes sure they haven't already voted
  21.     if(isset($_COOKIE[$cookie]))
  22.     {
  23.     echo "Sorry You have already voted this month<br>";
  24.     } 
  25. //sets a cookie
  26.     else
  27.     {
  28.     $month = 0 + time(); 
  29.     setcookie("voted", $cookie, $month);
  30.  
  31. //------------------------------------------
  32.  if (isset($_POST['submit'])) {
  33.     $vid=$_POST['vid'];
  34.     $prof=$_POST['prof'];
  35.     $name = $_POST['name'];
  36.     $city=$_POST['city'];
  37.     $email=$_POST['email'];
  38.     $vote=$_POST['vote'];
  39.  
  40.     $comm=$_POST['comm'];
  41.  
  42.     $sql = "INSERT INTO voters SET
  43.             prof='$prof',    
  44.             name='$name',
  45.             city='$city',
  46.             email='$email',
  47.             comm='$comm'
  48.             ";
  49.             mysql_query($sql);                     
  50.     if ($sql) 
  51.     {
  52.       echo '<p><font color="green"">New Entries Added</font></p>';
  53.       echo '<p><a href="index.htm">Back to Home Page</a></p>';
  54.       //mysql_close(); 
  55.  
  56.       //exit();
  57.     }
  58.     else
  59.     {    
  60.      mysql_error() ; 
  61.     }
  62. }    
  63. //----------------------------------------------------
  64. function checkprof($vote,$prof,$comm)
  65. {
  66.  
  67. $length = count($vote); //gets the length of the array 
  68. for($i=0; $i < $length; $i++)  //traverses the array and prints 
  69.   { 
  70.  
  71.     if ($prof == "Architect")
  72.      //{mysql_query ("UPDATE votetally  SET architect=architect+1 ,comm=concat(comm,' =  ','$comm') where nid=$vote");}
  73.     { mysql_query ("UPDATE tally  SET architect=architect+1 ,comm=concat(comm,' =  ','$comm') where nid=$vote");}
  74.      elseif ($prof == "Interior")
  75.     //{mysql_query ("UPDATE votetally SET interior = interior + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  76.         {mysql_query ("UPDATE tally SET interior = interior + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  77.      elseif ($prof == "Infrastructure") 
  78. //    {mysql_query ("UPDATE votetally SET infra = infra + 1 ,comm=concat(comm,' = ','$comm') where nid=$vote");}
  79.     {mysql_query ("UPDATE tally SET infra = infra + 1 ,comm=concat(comm,' = ','$comm') where nid=$vote");}
  80.     elseif ($prof == "Landscape") 
  81. //    { mysql_query ("UPDATE votetally SET land = land + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  82.     { mysql_query ("UPDATE tally SET land = land + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  83.    elseif ($prof == "Town")
  84. //    { mysql_query ("UPDATE votetally SET town= town+ 1 ,concat_ws(comm,' = ','$comm') where nid=$vote");}
  85.       { mysql_query ("UPDATE tally SET town= town+ 1 ,concat_ws(comm,' = ','$comm') where nid=$vote");}
  86.    elseif ($prof == "Consultant")
  87. //    { mysql_query ("UPDATE votetally SET consult = consult + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  88.         { mysql_query ("UPDATE tally SET consult = consult + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  89.   elseif ($prof == "Other") 
  90. //  {mysql_query ("UPDATE votetally SET other = other + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  91.     {mysql_query ("UPDATE tally SET other = other + 1,comm=concat_ws(comm,' = ','$comm') where nid=$vote");}
  92.     echo "$vote[$i]<br>"; }     
  93. }
  94.  
  95. }
  96.  
  97. $length = count($vote); //gets the length of the array 
  98.  
  99. for($i=0; $i < $length; $i++)  //traverses the array and prints 
  100.   { 
  101. switch ($vote)
  102. {
  103. case '1':
  104. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=1");
  105. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=1");
  106. checkprof($vote,$prof,$comm);
  107. break;
  108.  
  109. case '2':
  110. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=2");
  111. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=2");
  112. checkprof($vote,$prof,$comm);
  113. break;
  114.  
  115. case '3':
  116. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=3");
  117. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=3");
  118. checkprof($vote,$prof,$comm);
  119. break;
  120.  
  121. case '4':
  122. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=4");
  123. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=4");
  124. checkprof($vote,$prof,$comm);
  125. break;
  126.  
  127. case '5':
  128. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=5");
  129. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=5");
  130. checkprof($vote,$prof,$comm);
  131. break;
  132.  
  133. case '6':
  134. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=6");
  135. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=6");
  136. checkprof($vote,$prof,$comm);
  137. break;
  138.  
  139. case '7':
  140. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=7");
  141. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=7");
  142. checkprof($vote,$prof,$comm);
  143. break;
  144.  
  145. case '8':
  146. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=8");
  147. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=8");
  148. checkprof($vote,$prof,$comm);
  149. break;
  150.  
  151. case '9':
  152. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=9");3
  153. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=9");
  154. checkprof($vote,$prof,$comm);
  155. break;
  156.  
  157. case '10':
  158. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=10");
  159. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=10");
  160. checkprof($vote,$prof,$comm);
  161. break;
  162.  
  163. case '11':
  164. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=11");
  165. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=11");
  166. checkprof($vote,$prof,$comm);
  167. break;
  168.  
  169. case '12':
  170. //mysql_query ("UPDATE votetally SET tvote = tvote + 1 where nid=12");
  171. mysql_query ("UPDATE tally SET tvote = tvote + 1 where nid=12");
  172. checkprof($vote,$prof,$comm);
  173. break;
  174.  
  175. }
  176. echo "$vote[$i]<br>"; }
  177. //include "pie_chart.php";
  178.  
  179. //displays the poll results
  180. //pie ();
  181. }
  182. //} 
  183. //if they are not voting, this displays the results if they have already voted
  184. if(isset($_COOKIE[$cookie]))
  185. {
  186. //pie ();
  187. }
  188.  
  189. // or if they have not voted yet, they get the voting box
  190. else 
  191. {
  192. if(!$mode=='voted')
  193. {
  194. ?>
  195.  
  196. <script type="text/javascript">
  197. function chkcontrol(j) {
  198. var total=0;
  199. for(var i=0; i < document.form.vote.length; i++){
  200. if(document.form.vote[i].checked){
  201. total =total +1;}
  202. if(total > 2){
  203. alert("Please Select only Two") 
  204. document.form.vote[j].checked = false ;
  205. return false;
  206. }
  207. }
  208. </script>
  209. <script type="text/javascript">
  210. function validate(form) { 
  211.  
  212. if( document.form.name.value=="" )                   //Name
  213. {
  214. alert(" Name field can not be empty");
  215. document.form.name.focus();
  216. return false;
  217. }
  218.  
  219. if( document.form.email.value=="" )                   //E-MAIL
  220. {
  221. alert(" Email field can not be empty");
  222. document.form.email.focus();
  223. return false;
  224. }
  225.  
  226.  
  227. if( document.form.comm.value=="" )                       //Comment
  228. {
  229. alert("Comment field can not be empty");
  230. document.form.comm.focus();
  231. return false;
  232. }
  233.  
  234. }
  235. </script>
  236.  
  237.  
  238. </p></td></tr>
  239. <tr valign="top"> 
  240. <td height="93" colspan="2" valign="top">
  241.  
  242. <form name= 'form'  method ='POST' action= 'votes.php' onSubmit='return validate(this)'>
  243. <!--onSubmit="return check()";-->
  244.  
  245. <table width=100% border="1" >
  246. <tr>  <td height="20" colspan="2" ><p class="style41">Vote for ArchiDesign Modern Legend Of The Year Awards</p>
  247.     </TD></tr>
  248. </table>
  249. <table width=100%  border="1" ><tr> <td width=152 height="37" valign="top" ><b  class="smallbluebold" >Choose your category</b> </td>
  250. <td width=115 rowspan="1" >
  251.  <select name="prof" size="1" class="style38" >
  252.  <option value="Architect" selected>Architect</option>
  253.  <option value="Interior">Interior Designer</option>
  254.  <option value="Infrastructure">Infrastructure Professional</option>
  255.   <option value="Landscape">Landscape Designer </option>
  256.    <option value="Structure" selected>Structural / Consulting Engineer</option>
  257.  <option value="Town">Town Planner</option>
  258.  <option value="Consultant">Consultants (Glass, HVAC, Lighting, Plumbing) </option>
  259.   <option value="Other">Other </option>
  260.  
  261.  </select></td>
  262. <td width="103"><b  class="smallbluebold">Name</b></td>
  263. <td width="192"><input name="name" type="text" class="text8" ></td></tr></table>
  264. <table width="595" border="1" class="text7">
  265.   <tr>
  266.     <td width="60"><b class="smallbluebold">City</b></td>
  267.     <td width="208"><select name="city" size="1" class="style38" >
  268. <option value="Agra">Agra</option>
  269. <option value="Ahmednagar">Ahmednagar</option>
  270. <option value="Akola">Akola</option>
  271. <option value="Aligarh">Aligarh</option>
  272. <option value="Allahabad">Allahabad</option>
  273. <option value="Allepey">Allepey</option>
  274. <option value="Alwaye">Alwaye</option>
  275. <option value="Amalapuram">Amalapuram</option>
  276. <option value="Ambala">Ambala</option>
  277. <option value="Amravati">Amravati</option>
  278. <option value="Amritsar">Amritsar</option>
  279. <option value="Anantapur">Anantapur</option>
  280. <option value="Anekal">Anekal</option>
  281. <option value="Atur">Atur</option>
  282. <option value="Aurangabad">Aurangabad</option>
  283. <option value="Bagalkot">Bagalkot</option>
  284. <option value="Bahadur+Garh">Bahadur Garh</option>
  285. <option value="Bangalore">Bangalore</option>
  286. <option value="Bankura">Bankura</option>
  287. <option value="Bantwal">Bantwal</option>
  288. <option value="Belgaum">Belgaum</option>
  289. <option value="Bellary">Bellary</option>
  290. <option value="Bhagalpur">Bhagalpur</option>
  291. <option value="Bharatpur">Bharatpur</option>
  292. <option value="Bharuch">Bharuch</option>
  293. <option value="Bhavnagar">Bhavnagar</option>
  294. <option value="Bhopal">Bhopal</option>
  295. <option value="Bhubaneswar">Bhubaneswar</option>
  296. <option value="Bidar">Bidar</option>
  297. <option value="Bodinayakanur">Bodinayakanur</option>
  298. <option value="Calicut">Calicut</option>
  299. <option value="Chandigarh">Chandigarh</option>
  300. <option value="Chandrapur">Chandrapur</option>
  301. <option value="Chengalpattu">Chengalpattu</option>
  302. <option value="Chenganasserry">Chenganasserry</option>
  303. <option value="Chenganur,+Alappuzha+Dist">Chenganur, Alappuzha Dist</option>
  304. <option value="Chennai">Chennai</option>
  305. <option value="Chickmangalur">Chickmangalur</option>
  306. <option value="Chitradurga">Chitradurga</option>
  307. <option value="Cochin">Cochin</option>
  308. <option value="Coimbatore">Coimbatore</option>
  309. <option value="Coonoor">Coonoor</option>
  310. <option value="Cuddapah">Cuddapah</option>
  311. <option value="Cuttack">Cuttack</option>
  312. <option value="Daman">Daman</option>
  313. <option value="Davanagere">Davanagere</option>
  314. <option value="Dehradun">Dehradun</option>
  315. <option value="Delhi">Delhi</option>
  316. <option value="Dhanbad">Dhanbad</option>
  317. <option value="Dharmapuri">Dharmapuri</option>
  318. <option value="Dibrugarh">Dibrugarh</option>
  319. <option value="Dindigul">Dindigul</option>
  320. <option value="Ernakulam">Ernakulam</option>
  321. <option value="Erode">Erode</option>
  322. <option value="Faridabad">Faridabad</option
  323. ><option value="Gandhinagar">Gandhinagar</option>
  324. <option value="Ghaziabad">Ghaziabad</option>
  325. <option value="Goa">Goa</option>
  326. <option value="Godhra">Godhra</option>
  327. <option value="Gulbarga">Gulbarga</option
  328. ><option value="Gundlupet">Gundlupet</option>
  329. <option value="Guntur">Guntur</option>
  330. <option value="Gurgaon">Gurgaon</option>
  331. <option value="Gwalior">Gwalior</option>
  332. <option value="Hassan">Hassan</option>
  333. <option value="Hosur">Hosur</option>
  334. <option value="Hubli">Hubli</option>
  335. <option value="Hyderabad">Hyderabad</option>
  336. <option value="Hyderabad++Secunderabad">Hyderabad Secunderabad</option>
  337. <option value="Idukki+Dist">Idukki Dist</option>
  338. <option value="Indore">Indore</option>
  339. <option value="Jabalpur">Jabalpur</option>
  340. <option value="Jaipur">Jaipur</option>
  341. <option value="Jalandhar">Jalandhar</option>
  342. <option value="Jalgaon">Jalgaon</option>
  343. <option value="Jammu">Jammu</option>
  344. <option value="Jamshedpur">Jamshedpur</option>
  345. <option value="Jhansi">Jhansi</option>
  346. <option value="Jind">Jind</option>
  347. <option value="Jodhpur">Jodhpur</option>
  348. <option value="Kakinada">Kakinada</option>
  349. <option value="Kalol">Kalol</option>
  350. <option value="Kanchipuram">Kanchipuram</option>
  351. <option value="Kannur">Kannur</option>
  352. <option value="Kanpur">Kanpur</option>
  353. <option value="Kanyakumari">Kanyakumari</option>
  354. <option value="Karaikal">Karaikal</option>
  355. <option value="Karaikudi">Karaikudi</option>
  356. <option value="Karimnagar+District">Karimnagar District</option>
  357. <option value="Karnal">Karnal</option>
  358. <option value="Karnataka">Karnataka</option>
  359. <option value="Kasaragod">Kasaragod</option>
  360. <option value="Kathiar">Kathiar</option>
  361. <option value="Kengeri">Kengeri</option>
  362. <option value="Khammam">Khammam</option>
  363. <option value="Kolar">Kolar</option>
  364. <option value="Kolhapur">Kolhapur</option>
  365. <option value="Kolkata">Kolkata</option>
  366. <option value="Kollam">Kollam</option>
  367. <option value="Kota">Kota</option>
  368. <option value="Kothagudem">Kothagudem</option>
  369. <option value="Kottayam">Kottayam</option>
  370. <option value="Kovilpatti">Kovilpatti</option>
  371. <option value="Krishnagiri">Krishnagiri</option>
  372. <option value="Kullu">Kullu</option>
  373. <option value="Kundapur">Kundapur</option>
  374. <option value="Kundli">Kundli</option>
  375. <option value="Kurnool">Kurnool</option>
  376. <option value="Kurukshetra">Kurukshetra</option>
  377. <option value="Kuzhithurai">Kuzhithurai</option>
  378. <option value="Lucknow" selected>Lucknow</option>
  379. <option value="Ludhiana">Ludhiana</option>
  380. <option value="Madhurai">Madhurai</option>
  381. <option value="Madikeri">Madikeri</option>
  382. <option value="Madurai">Madurai</option>
  383. <option value="Malappuram">Malappuram</option>
  384. <option value="Mandya">Mandya</option>
  385. <option value="Mangalore">Mangalore</option>
  386. <option value="Mavelikara,+Alappuzha+Dist">Mavelikara,Alappuzha Dist</option>
  387. <option value="Meenangadi">Meenangadi</option>
  388. <option value="Meerut">Meerut</option><option value="Mehsana+City">Mehsana City</option>
  389. <option value="Mettupalayam">Mettupalayam</option>
  390. <option value="Midnapur">Midnapur</option>
  391. <option value="Miryalguda">Miryalguda</option>
  392. <option value="Mohali">Mohali</option>
  393. <option value="Moradabad">Moradabad</option>
  394. <option value="Mumbai">Mumbai</option>
  395. <option value="Mysore">Mysore</option>
  396. <option value="Nagapattinam">Nagapattinam</option>
  397. <option value="Nagercoil">Nagercoil</option>
  398. <option value="Nagpur">Nagpur</option>
  399. <option value="Nallasopara">Nallasopara</option>
  400. <option value="Namakkal">Namakkal</option>
  401. <option value="Narasaraopet">Narasaraopet</option>
  402. <option value="Nasik">Nasik</option>
  403. <option value="Nellore">Nellore</option>
  404. <option value="New Delhi">New Delhi</option>
  405. <option value="Noida">Noida</option>
  406. <option value="Ongole">Ongole</option>
  407. <option value="Ooty">Ooty</option>
  408. <option value="Palakkad">Palakkad</option>
  409. <option value="Palwal">Palwal</option>
  410. <option value="Panchkula">Panchkula</option>
  411. <option value="Pandalam">Pandalam</option>
  412. <option value="Panipat">Panipat</option>
  413. <option value="Panjim">Panjim</option>
  414. <option value="Panvel">Panvel</option>
  415. <option value="Patan">Patan</option>
  416. <option value="Pathanamthitta">Pathanamthitta</option>
  417. <option value="Patiala">Patiala</option>
  418. <option value="Patna">Patna</option>
  419. <option value="Pollachi">Pollachi</option>
  420. <option value="Pondicherry">Pondicherry</option><option value="Pune">Pune</option><option value="Puttur">Puttur</option><option value="Raichur">Raichur</option><option value="Raipur">Raipur</option><option value="Rajamundry">Rajamundry</option><option value="Rajapalyam">Rajapalyam</option><option value="Rajkot">Rajkot</option><option value="Ranchi">Ranchi</option><option value="Ranebennur">Ranebennur</option><option value="Rohtak">Rohtak</option><option value="Salem">Salem</option><option value="Sangli">Sangli</option><option value="Satara">Satara</option><option value="Shimla">Shimla</option><option value="Shimoga">Shimoga</option><option value="Siliguri">Siliguri</option><option value="Silvassa">Silvassa</option><option value="Sirmaur">Sirmaur</option><option value="Sirsi">Sirsi</option><option value="Sivagangai">Sivagangai</option><option value="Sivakasi">Sivakasi</option><option value="Solapur">Solapur</option><option value="Sriperumbadur">Sriperumbadur</option><option value="Sullia">Sullia</option><option value="Sulthan+Batheri">Sulthan Batheri</option>
  421. <option value="Surat">Surat</option>
  422. <option value="Tadepalligudam">Tadepalligudam</option>
  423. <option value="Tanaku">Tanaku</option>
  424. <option value="Tanuku">Tanuku</option>
  425. <option value="Teynampet">Teynampet</option>
  426. <option value="Thanjavur">Thanjavur</option>
  427. <option value="Theni">Theni</option>
  428. <option value="Thirthahalli">Thirthahalli</option>
  429. <option value="Thiruvallur">Thiruvallur</option>
  430. <option value="Tiruchendur">Tiruchendur</option>
  431. <option value="Tirunelveli">Tirunelveli</option>
  432. <option value="Tirupathi">Tirupathi</option>
  433. <option value="Tirupur">Tirupur</option>
  434. <option value="Tiruvalla">Tiruvalla</option>
  435. <option value="Tiruvellore">Tiruvellore</option>
  436. <option value="Trichy">Trichy</option>
  437. <option value="Tripunithura">Tripunithura</option>
  438. <option value="Trissur">Trissur</option>
  439. <option value="Trivandrum">Trivandrum</option>
  440. <option value="Tumkur">Tumkur</option>
  441. <option value="Tuticorin">Tuticorin</option>
  442. <option value="Udaipur">Udaipur</option>
  443. <option value="Udipi">Udipi</option>
  444. <option value="Una">Una</option>
  445. <option value="Vadodara+(Baroda)">Vadodara (Baroda)</option>
  446. <option value="Valsad">Valsad</option>
  447. <option value="Vapi">Vapi</option>
  448. <option value="Varanasi">Varanasi</option>
  449. <option value="Vellore">Vellore</option>
  450. <option value="Vijayawada">Vijayawada</option>
  451. <option value="Visakhapatnam">Visakhapatnam</option>
  452. <option value="Vizinagaram">Vizinagaram</option>
  453. <option value="Vyasarpadi">Vyasarpadi</option>
  454. <option value="Warangal">Warangal</option>
  455. <option value="Yawatmal">Yawatmal </option>
  456. </select></td>
  457.  
  458. <td width="107"><b class="smallbluebold">Email Address</b></td>
  459. <td width="187"><input name="email" type="text" class="text8" ></td></tr></table><br/>
  460. <table width="550" height="203" border="0" align=center cellpadding="0" cellspacing="0">
  461.  
  462.     <tr>
  463.     <td width="20" ></td>
  464.     <td width="264" ><b>Select your choice</b></td></tr>
  465.     <tr>
  466.       <td ><input type=checkbox name=vote value=1 onClick="chkcontrol(0)";></td>
  467.       <td >Ar. Hasmukh C. Patel, Ahmedabad</td>
  468.       <td ><input type=checkbox name=vote value=2 onClick="chkcontrol(1)";></td>
  469.       <td >Ar. Jasbir Sachdev, New Delhi</td>
  470.     </tr>
  471.     <tr>
  472.       <td ><input type=checkbox name=vote value=3 onClick="chkcontrol(2)";></td>
  473.       <td >Ar. Jasbir Sahwney, New Delhi</td>
  474.       <td ><input type=checkbox name=vote value=4 onClick="chkcontrol(3)";></td>
  475.       <td >Ar. K. R. Jaisim, Bangalore</td>
  476.     </tr>
  477.     <tr>
  478.       <td ><input type=checkbox name=vote value=5 onClick="chkcontrol(4)";></td>
  479.       <td >Ar. Kuldeep Singh, New Delhi</td>
  480.       <td ><input type=checkbox name=vote value=6 onClick="chkcontrol(5)";></td>
  481.       <td >Ar. M. M. Rana, New Delhi</td>
  482.     </tr>
  483.     <tr>
  484.       <td ><input type=checkbox name=vote value=7 onClick="chkcontrol(6)";></td>
  485.       <td >Ar. Probir Mitra, Kolkata</td>
  486.       <td ><input type=checkbox name=vote value=8 onClick="chkcontrol(7)";></td>
  487.       <td > Ar. Rajinder Kumar (RKA), New Delhi </td>
  488.     </tr>
  489.     <tr>
  490.       <td ><input type=checkbox name=vote value=9 onClick="chkcontrol(8)";></td>
  491.       <td >Ar. S. R. Sikka, New Delhi</td>
  492.       <td ><input type=checkbox name=vote value=10 onClick="chkcontrol(9)";></td>
  493.       <td > Ar. S. L. Chitle, Chennai</td>
  494.     </tr>
  495.     <tr>
  496.       <td ><input type=checkbox name=vote value=11 onClick="chkcontrol(10)";></td>
  497.       <td >Ar. Shivdutt Sharma, Chandigarh</td>
  498.       <td ><input type=checkbox name=vote value=12 onClick="chkcontrol(11)";></td>
  499.       <td >Ar. U. C. Jain, Mumbai</td>
  500.     </tr>
  501.  
  502. </table>
  503.  
  504.  
  505. </form >
  506.  
  507.  <?php }}?>[/PHP]
Dec 7 '07 #1
0 3118

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

Similar topics

2
10648
by: scott | last post by:
Hi, I'm having some trouble with something that should be relatively easy. I want to update multiple rows in one of my database tables simultaneously. In my table I have these values: imageID image_order I want to be able to modify the image_order column where imageID = imageID.
15
7390
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great atmosphere. Good food.", " (Harry Houdini - 03/01/2004)"); INSERT INTO `reviews` VALUES("", "Le Chow Place", "Lunch", "yada yada", " (Herbert Hoover - 03/03/2004)"); INSERT INTO `reviews` VALUES("", "Golden Dragon", "Lunch", "Exquisite.
7
2496
by: Paige | last post by:
I have a database on my local machine that I make entries and corrections on. I'd like to be able to upload that to my server and have that update the database that's on the server. What I've been doing is saving the local file as a backup. Then I have to edit the backup, deleting the create file info and all previously uploaded entries before I can import the text file to the server. Is there an easier way to do this so I won't get...
2
3245
by: dukeofwhelmsley | last post by:
Hello, I have a database generated form that I would like users to be able to update by selecting a checkbox. Say the page displayed has six records on it and the user wants to delete one or more of the records. They would click the checkbox and hit a "delete" button. Then the database would be updated and the user redirected back to the page that would now show all the records that weren't deleted. Sort of like Yahoo mail, you get a list...
6
1685
by: Rudi Ahlers | last post by:
A different question though. Is it possible to delete duplicate entries, where the email address is the same, and only keep one? i.e.. I got say 4 DB entries, all with the same email address, and I want to delete 3. How do I do this? -- Kind Regards
33
3341
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range of 20 steps) On the admin page the steps are listed, in "order" order and the user can create new steps and assign an order and all is well. The problem may come in using a renumber function which should take the steps in their current order...
10
2234
by: chimambo | last post by:
Hi All, I have a little problem. I am retrieving records from a table and I want to update the records using checkboxes. I am able to display the database record quite alright and I have created an array of checkboxes, but my update loop is not working. Here is my code: /*---------This retrieves the records -------------*/ if($row_md) { do{ echo "<tr><td text align='right'>";
2
2644
by: julie18881 | last post by:
I may be being really stupid here, i have spent the last 3 hours looking round your site and some other for answers to my problem, but have not had much luck (possibly cuase my brain just isn't working today) I have EasyPHP2.0b1 Apache/MySQL server installed on my Windows XP(SP2) machine. This runs Apache 2.2.3, MySQL 5.0.27 and PHP 5.2.0 I have a PHP code filled listbox, which allows multiple selections. Actual Values are "rcd_no, cn_no"...
5
7038
by: TechnoAtif | last post by:
Hi All..'mAtif..i've got stuck within checkboxes these days..i've got many input items like checkboxes,textarea and along with them there are many checkboxes...all the data except the checkbox's is comfortably getting entered into the database but the real problem is with the checkboxes..only one entry is being stored ...but i want to enter the multiple entries from the checkboxes to enter into the database...the form is a voting poll..and i...
0
8948
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8780
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9315
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8190
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6742
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3264
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 we have to send another system
3
2182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.