RE: [PHP-DB] 5 hours later - sql error.
| From: | Bastien Koert | Date: | Thu, 02 Dec 2004 23:19:57 +0000 |
| Subject: | RE: [PHP-DB] 5 hours later - sql error. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37533@lists.php.net to get a copy of this message | ||
can you post the code that creates the sql statement
bastien
From: Stuart Felenstein <stuart4m@yahoo.com> To: "Gryffyn, Trevor" <TGryffyn@air-cargo-inc.com>, php-db@lists.php.net CC: Stuart Felenstein <stuart4m@yahoo.com> Subject: RE: [PHP-DB] 5 hours later - sql error. Date: Thu, 2 Dec 2004 14:50:24 -0800 (PST) --- "Gryffyn, Trevor" <TGryffyn@air-cargo-inc.com> wrote: Looks like your $expLevl value is empty. It's probably set, but has no value in it. Check that. No sorry to say that isn't it. It seems that for every field i submit in the search, it's the field right after where the syntax error is reported. So , maybe it's not truly a syntax error. Just to reiterate (and it's like 75 lines of code, so I'm going to spare the group) $aWHERE = array(); $query_rsCS = "SELECT .........[the rest of the select]................." //Here are the clauses for the dynamic query //There are 50+ so, this is how they are written if(isset($workAuth)) $aWHERE[] = "Prof.WorkAuth IN ($workAuth)"; if(!empty($aWHERE)); //This is how I attach the where clauses where user //has chosen a field $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE); Now I've printed out the query, but it only prints out right up to the where clause. To me it looks like the where clause is not taking correctly but I'm not sure why or how to know for usre. I'm tried print_r ($query_rsCS) but it's returning nothing. Either it's empty for some reason, or the suppposed syntax error is stopping it. Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php