5 hours later - sql error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm running into a syntax error:

You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the
right syntax to use near ') AND Prof.WorkExp IN () AND
Prof_Industries.

Now I printed out the query and that works as I dumped
it into a mysql client and it returned correctly.

Maybe I can get by here with out all the code. 
Basically I do a select of all the tables, then the
joins.  No where condition yet.  This is a dynamic
query - 

After the sql I have 

$aWHERE = array();

if(isset($resAge)) $aWHERE[] = "Prof_Rez.Age >=
DATE_SUB(CurDate(), Interval($resAge) DAY)";
if(isset($workAuth)) $aWHERE[] = "Prof.WorkAuth IN
($workAuth)";
if(isset($expLevel)) $aWHERE[] = "Prof.WorkExp IN
($expLevel)"; ..............etc.

$query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE);

Anyway while I basically took this code from a search
that is working - what I wonder is if the where
statement is correct .  

Well let me start here and see.
Thank you 
Stuart

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux