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.

5
  • Maybe tell us what database you are using. I gather via your tags that your backend language is PHP. Commented 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 ? Commented 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. Commented Apr 28, 2015 at 20:19
  • See if this helps: stackoverflow.com/questions/7851868/… Commented Apr 28, 2015 at 20:20
  • @bytesized i use phpmyadmin /wamp server Commented Apr 28, 2015 at 22:04

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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?
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.