lopes_andre Posted February 25, 2009 Share Posted February 25, 2009 Hi, I'am doing a form with checkboxes that will be edited by the users... the user can create/modify/delete the values of the checkboxes and I have to store that values. I never deal with this type of situation... What is the best option to deal with this? Create a table in the database(mysql) with one column for each checkbox of the form? Best Regards, André. Link to comment https://forums.phpfreaks.com/topic/146845-store-values-of-checkboxes/ Share on other sites More sharing options...
ram4nd Posted February 25, 2009 Share Posted February 25, 2009 Create a table in the database(mysql) with one column for each checkbox of the form? Yes. But use tinyint to hold the value. Checked is 1, unchecked is 0 or something. I thing there is no true/false type columns in mysql. Link to comment https://forums.phpfreaks.com/topic/146845-store-values-of-checkboxes/#findComment-770938 Share on other sites More sharing options...
lopes_andre Posted February 25, 2009 Author Share Posted February 25, 2009 Thanks for your reply. I forgot that I will need to use the values of the checkboxes to construct an SQL query. Wich is the best option? Use values of 1/0 in the checkbox value or use a string in the value of the checkbox? I'am a litle bit confused because I need to store in the database if the checkbox is checked or not checked and I need to construct a query. What should I do? Best Regards, André. Link to comment https://forums.phpfreaks.com/topic/146845-store-values-of-checkboxes/#findComment-770996 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.