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 "
--- "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
> -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){
--- 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)"
--- 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
- 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
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