Here's the scene:
A voting form with one question - 'select your favourite colour'
and radio buttons for: red, blue, green.
The radio button value (red, blue or green) is sent to the db and inserted into a table column - so I get one column with all the colours in it.
ie: red, red, red, blue, green, red, blue... etc.
No problems so far, I can sort them out into a bar graph on a webpage.
Here's the problem : I need to export the data as a csv file and I need one column for each colour.
If I have a table called 'Favourites' and three columns 'fav_red', 'fav_blue' and 'fav_green', how would I get the value from the radio button and insert it into the correct column?
What would the sql be?
This would be easy to do with checkboxes but I need to limit the voter to only one choice so it has to be radio buttons.
Hope this is clear enough and someone can help or point me to a tutorial. Thanx!