Welcome Guest, Not a member yet? Register   Sign In
Handling Multiple Checkboxes
#3

[eluser]Craig A Rodway[/eluser]
Usually you would want to normalise that data and create another table to store the days - but you'd also need to change the values for each day - at the moment, day[] is probably being set to '1' no matter which ones are checked. Once you use values from 1 through to 5, you will end up with an array called day[] with values being set properly.

If you don't need to search the database using the days, you could use the PHP serialize() function to convert the day[] array to a string which you can store in a single DB field.


Messages In This Thread
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:13 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:29 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:31 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 12:37 PM
Handling Multiple Checkboxes - by El Forum - 01-03-2010, 01:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB