PHP Check the checkbox if the data is same with database -


Let me know how to check the check box, if I have checked before that the patient has already checked For example, when I connect the patient, I checked 1 and 2. When I want to edit the patient's information, check the 1 and 2 checkboxes. Please help me solve the problem Thank you. Create table "tblmedicalhistory" (id varchar (12) faucet primary key, blood type char (3), diseases varchar (30)), "create table", tblmedicalrecord (ID) It Not Atangment, Primary Key (ID), Medical Records Type varchar (20)), "//form1.php" lt ;? Php $ data = array (); $ Disease: all = $ medicare ['disease']; $ Array = explosion (",", $ disease split); Forex Currency ($ array as $ item) {$ data [$ item] = true; }? & Gt; & Lt; TR & gt; & Lt ;? Php $ query = "SELECT * FROM tblmedicalrecord"; $ Result = mysql_query ($ query); Look for "label class = 'q' = 'q1' & gt; & lt; / label & gt;"; While ($ r = mysql_fetch_array ($ result)) {resonant "& lt; tr & gt;"; Echo "& lt; td & gt; & lt; input type = 'checkbox' name = 'q1 []'"; Echo "value =". $ R ['id']. "& Gt;" $ $ [[Medical record type]] ". & Lt; / td>; Echo "& lt; / tr & gt;"; } Resonate "& lt; / select & gt;"; ? & Gt; & Lt; / TR & gt;

You need to first store where you can define how to value Check whether or not Here I am considering that you have a record of the test ID for a particular patient, which says:

  $ rec = array ("1", "2");  

Check box 1 and check box 2 is checked for that patient

   "; $ Str. =" & Lt; / Tr & gt; "; $ Echo ;; echo" & lt; / Select & gt; ";? & Gt;  

Comments

Popular posts from this blog

mysql - How to enter php data into a html multiple select box -

java - Can't add JTree to JPanel of a JInternalFrame -

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -