Re: Conditonal where

2004-11-15 Thread Michael Stassen
Stuart Felenstein wrote: --- "Adams, Pat 006" <[EMAIL PROTECTED]> wrote: You could add a where condition that's always true to the main part of the SQL statement so that you can just tack on more clauses conditionally. $sql .= "SELECT PostStart, JobTitle, Industry, LocationState, VendorID "

RE: Conditonal where

2004-11-15 Thread Stuart Felenstein
--- "Adams, Pat 006" <[EMAIL PROTECTED]> wrote: > You could add a where condition that's always true > to the main part of > the SQL statement so that you can just tack on more > clauses > conditionally. > > $sql .= "SELECT PostStart, JobTitle, Industry, > LocationState, VendorID " > . "FRO

RE: Conditonal where

2004-11-15 Thread Adams, Pat 006
> -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: Sunday, November 14, 2004 11:30 AM > To: [EMAIL PROTECTED] > Subject: Conditonal where > > $sql .= " SELECT PostStart, JobTitle, Industry, > LocationState, VendorID FROM VendorJobs"; > > if ($s_Ind){

Re: Conditonal where

2004-11-14 Thread Stuart Felenstein
--- Chris <[EMAIL PROTECTED]> wrote: > What I tend to do in this situation is have a WHERE > array: > > $sql .= " SELECT PostStart, JobTitle, Industry, > LocationState, VendorID FROM VendorJobs"; > > > $aWHERE = array(); > if(isset($s_Ind)) $aWHERE[] = > "VendorJobs.LocationState IN ($s_Ind)"

Re: Conditonal where

2004-11-14 Thread Stuart Felenstein
--- Rhino <[EMAIL PROTECTED]> wrote: > No offense, Stuart, but I really can't make out what > you are asking; the > question is bordering on incoherent. Well it's probably true that I'm losing it :) Chris though understood even through my inane babbling. Except while the statements are corre

Re: Conditonal where

2004-11-14 Thread Rhino
- Original Message - From: "Stuart Felenstein" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, November 14, 2004 12:30 PM Subject: Conditonal where > Question - I'm creating a dynamic query (using PHP) > but my question I think is more related to mysql > syntax. > Right now I

Re: Conditonal where

2004-11-14 Thread Chris
Stuart Felenstein wrote: Question - I'm creating a dynamic query (using PHP) but my question I think is more related to mysql syntax. Right now I have these statements: if ($s_State){ $sql .= " AND VendorJobs.LocationState IN ($s_State)"; } What I think I need is some kind of default "WHERE" in th