I am an electronic engineering student. I have a doubt concerning Web development. I have to make a web site for doctors to enter patients data. Most of the data are in check box format. My question is regarding saving and re fetching check box status from the data base, so that the user can see what all are checked previously and what all are not checked when he log's in back the next time. And also how can i replace the check-box status in database if i change the status. I searched about this in internet but there is no much data concerning this. So if anyone could guide me or give me a link or example codes where i can look and study, it will be a great help for me.
-
Maybe tell us what database you are using. I gather via your tags that your backend language is PHP.bytesized– bytesized2015-04-28 20:09:23 +00:00Commented Apr 28, 2015 at 20:09
-
Can you post the code that you have tried so far and also post what exactly is not working ?Maximus2012– Maximus20122015-04-28 20:09:30 +00:00Commented Apr 28, 2015 at 20:09
-
@Maximus2012 i made the check boxes and saved the data's in database . Now i want to know how to re fetch the status and how to replace it if i make a change the next time i logged in.user3747901– user37479012015-04-28 20:19:08 +00:00Commented Apr 28, 2015 at 20:19
-
See if this helps: stackoverflow.com/questions/7851868/…Maximus2012– Maximus20122015-04-28 20:20:28 +00:00Commented Apr 28, 2015 at 20:20
-
@bytesized i use phpmyadmin /wamp serveruser3747901– user37479012015-04-28 22:04:22 +00:00Commented Apr 28, 2015 at 22:04
1 Answer
You can save the values of a particular check box in many different way and there are tons of resources online for this, I am sure you have come accross this information before.
You could save your check box values as a string with a string delimiter, for example: A-B-C-D-E. This was you can split/explode the string whenever you need to retrieve the values again as an array and appropriately mark the corresponding check boxes once they sign in again.
Some Resources: http://www.html-form-guide.com/php-form/php-form-checkbox.html
send checkbox value in PHP form