Click to See Complete Forum and Search --> : Python --> MySQL with HTML Form


invision
12-03-2005, 06:45 AM
Hello,

I want to add the values of the selected checkboxes to a MySQL table, seperating each seperate value with a comma if possible.

I'm messing around a little with Python right now and one of the options in my web page is the following :

Are you involved in any of the following?:<br>
<input type="checkbox" name="ftb" value="Football"> Football<br>
<input type="checkbox" name="rgb" value="Rugby"> Rugby<br>
<input type="checkbox" name="ten" value="Tennis"> Tennis<br>

part of the table code is here , i'm calling the column 'involved' :

involved SET('Football','Rugby','Tennis') NOT NULL,

now, the table is called 'test' and the INSERT INTO code I'm using is :

involved('ftb','rgb','ten')

Do I need to define 'involved' in the Python script, and how should I do this ?

This might be a bit confusing without showing the full code. But everything else in the html form is submitted to the table, except this.

I basically want it to insert all the boxes that are checked by the user in a comma seperated list.

Any help would be great.

Thanks.

invision
12-06-2005, 09:26 AM
Managed to solve the problem, I used a FOR loop and some jiggery-pokery.