-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 14, 2004 11:30 AM
To: [EMAIL PROTECTED]
Subject: Conditonal where
?php
$sql .= SELECT PostStart, JobTitle, Industry,
LocationState, VendorID FROM VendorJobs;
if ($s_Ind){
$sql
--- 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
. FROM VendorJobs
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
.
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:
?php
$sql .= SELECT PostStart, JobTitle, Industry,
LocationState, VendorID FROM VendorJobs;
if ($s_Ind){
$sql .= WHERE VendorJobs.Industry IN
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:
?php
$sql .= SELECT PostStart, JobTitle, Industry,
LocationState, VendorID FROM VendorJobs;
if ($s_Ind){
$sql .= WHERE
- 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 have
--- 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 correct,
--- 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)