RE: [PHP-DB] 5 hours later - sql error.

From: Date: Thu, 02 Dec 2004 19:19:00 +0000
Subject: RE: [PHP-DB] 5 hours later - sql error.
Groups: php.db 
Request: Send a blank email to php-db+get-37530@lists.php.net to get a copy of this message
Looks like your $expLevl value is empty. It's probably set, but has no value in it. Check that. -TG > -----Original Message----- > From: Stuart Felenstein [mailto:stuart4m@yahoo.com] > Sent: Thursday, December 02, 2004 1:46 PM > To: php-db@lists.php.net > Subject: [PHP-DB] 5 hours later - sql error. > > > 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 > >

« previous php.db (#37530) next »