RE: Checkboxes

2006-07-26 Thread George Law
26, 2006 12:04 PM >>>To: mysql@lists.mysql.com >>>Subject: Checkboxes >>> >>>I am trying to allow a user to use checkboxes for multiple >>>selections, and I am trying to get the database to record >>>the choices made by the user. I am using a VAR

Re: Checkboxes

2006-07-26 Thread Martin Jespersen
use an integer and you need some kind of string representation of the choice, use a secondary table to hold the string values and let the integer in the main table be a foreign key to the secondary table ;) Nicholas Vettese wrote: I am trying to allow a user to use checkboxes for multiple

Re: Checkboxes

2006-07-26 Thread Peter Brawley
Nicholas Vettese wrote: I am trying to allow a user to use checkboxes for multiple selections, and I am trying to get the database to record the choices made by the user. I am using a VARCHAR(250), but I am guessing that may be wrong. Also, other than adding a "[]" to the end of

Checkboxes

2006-07-26 Thread Nicholas Vettese
I am trying to allow a user to use checkboxes for multiple selections, and I am trying to get the database to record the choices made by the user. I am using a VARCHAR(250), but I am guessing that may be wrong. Also, other than adding a "[]" to the end of the 'name' (e.g

RE: Complex SQL involving 10 checkboxes

2003-06-21 Thread Michael Scott
) // $SQL will contain "penpals.agegroup IN ( 00,01" CALL FUNCTION ('check04','04',',', $First) // $SQL will contain "penpals.agegroup IN ( 00,01,04" $SQL .= " )"; // $SQL will cont

RE: Complex SQL involving 10 checkboxes

2003-06-20 Thread Don Read
at > other > times the user will select more than one needing an OR statement between > the > two checkboxes. Make sense? > > Use an array. $agesel=implode("', '", $HTTP_GET_VARS['ageselect,]); $qry="SELECT * FROM foo WHERE penpals.agegro

RE: Complex SQL involving 10 checkboxes

2003-06-19 Thread Mike Hillyer
ny checks, and because you rip the last or and replace it with an and, you are always Ok for what follows. > -Original Message- > From: vernon [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 19, 2003 1:49 PM > To: Mike Hillyer > Subject: RE: Complex SQL involving 10

Re: Complex SQL involving 10 checkboxes

2003-06-19 Thread PeterWR
best regards Peter - Original Message - From: "Mike Hillyer" <[EMAIL PROTECTED]> To: "vernon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, June 19, 2003 8:57 PM Subject: RE: Complex SQL involving 10 checkboxes Well, if one checkbox represents ages

RE: Complex SQL involving 10 checkboxes

2003-06-19 Thread Mike Hillyer
e a code question. Essentially you just build the query in chunks. By the nature of checkboxes you probably just need Ors, not ANDs. You may need to rip the trailing OR, maybe replacing it with an AND if you need to add some other condition on the end that needs an AND. Unless of course someone can be

RE: Complex SQL involving 10 checkboxes

2003-06-19 Thread vernon
times the user will pick checkbox 1 and 5 but not 2,3,4,6, 7, 8, and 9. And then again there will be times when a user only uses one check box needing the AND statement on the end, but at other times the user will select more than one needing an OR statement between the two checkboxes. Make se

RE: Complex SQL involving 10 checkboxes

2003-06-19 Thread Mike Hillyer
Well, if one checkbox represents ages 1-5, another represents 6-9, and another represents 10-15, then you have the checkboxes add where clauses. Here is a pseudocode/basic example: *START WITH A SELECT* SQL = "SELECT * FROM TABLE WHERE" *BUILD THE WHERE CLAUSES* IF check1 THEN SQL = S

Complex SQL involving 10 checkboxes

2003-06-19 Thread vernon
I'm trying to setup a SQL statement that involes using 10 different checkboxes. The checkboxes repersent age groups that I need to forward to an SQL statement. What would be the easiest way to do this? As I think this through I'm thinking I have to check it 1 and 2 are checked and n