0

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.

1 Answers1

1

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

Community
  • 1
  • 1
  • I saw the code but there is no much detail of how to re fetch the data from the DATABASE..As you recommended, In many pages i saw some mentioning of explode and implode but i couldn't understand it ,can you help? – user3747901 Apr 28 '15 at 20:35
  • Read the value from the database as a simple string. Then once you explode the string by the '-' delimiter you now have an array of all the values. Now with that array you can use Javascript or JQuery to match the corresponding input either by their value or id, depending on how you set up your check boxes. –  Apr 28 '15 at 20:37