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
On 19-Jun-2003 vernon wrote: > > OK, I've done this. > > Problem occurs when a user selects 1 and 9. > > The SQL statement I have reads like so: > > if (isset($HTTP_GET_VARS['check00'])) { > $age00 = '00'; > $s_age00 = "penpals.agegroup = $age00 AND"; > } > > Problem is the AND s

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
long to more than one agegroup. If so you better post what the table looks like. Regards, Mike Hillyer > -Original Message- > From: vernon [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 19, 2003 1:25 PM > To: [EMAIL PROTECTED] > Subject: RE: Complex SQL involvin

RE: Complex SQL involving 10 checkboxes

2003-06-19 Thread vernon
nse? -- Original Message --- From: "Mike Hillyer" <[EMAIL PROTECTED]> To: "vernon" <[EMAIL PROTECTED]>, Sent: Thu, 19 Jun 2003 12:57:20 -0600 Subject: RE: Complex SQL involving 10 checkboxes > Well, if one checkbox represents ages 1-5, anot

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 = SQL & " age B