--- "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"
> . "WHERE 1 = 1 ";
> if ($s_Ind) {
> $sql .= "AND VendorJobs.Industry IN ($s_Ind) ";
> }
> if ($s_State) {
> $sql .= " AND VendorJobs.LocationState IN
> ($s_State)";
> }
>
See I knew I wasn't crazy as Rhino may have suggested
:). I had a vague idea that 1=1 would have worked but
sadly I did not test it. Anyway, I went with just a
blank array and as values are set , the where clause
grows dynamically.
Thanks for your help.
Stuart
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]