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

2004-12-03 Thread Stuart Felenstein
--- John Holmes [EMAIL PROTECTED] wrote: Stuart Felenstein wrote: Print out the entire query before you run it. Syntax errors are usually pretty obvious. If not, post the actual query here. I found one possible syntax error and fixed it though it seemed to have no effect. I'm posting the

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

2004-12-03 Thread Stuart Felenstein
--- Bastien Koert [EMAIL PROTECTED] wrote: can you post the code that creates the sql statement bastien I'm posting the entire script. I hope it comes through legible. If not I can do an attachment so the format, line breaks will remain. ?php session_start(); $currentPage =

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

2004-12-03 Thread Graham Cossey
One observation: print_r($query_rsCS); if(!empty($aWHERE)); ^ Remove semi-colon ? $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE); print_r($aWHERE); HTH Graham -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

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

2004-12-03 Thread John Holmes
Stuart Felenstein wrote: if(isset($stateReloc2)) $aWHERE[] = Prof.State1 IN ($stateReloc2); You need to check if $stateReloc2, etc are empty() instead of set. If the variable is set, but empty, you're going to end up with a query like Prof.State1 IN () which will cause your error, which we would

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

2004-12-03 Thread Stuart Felenstein
--- John Holmes [EMAIL PROTECTED] wrote: Stuart Felenstein wrote: if(isset($stateReloc2)) $aWHERE[] = Prof.State1 IN ($stateReloc2); You need to check if $stateReloc2, etc are empty() instead of set. If the variable is set, but empty, you're going to end up with a query like

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

2004-12-03 Thread Stuart Felenstein
--- John Holmes [EMAIL PROTECTED] wrote: You need to check if $stateReloc2, etc are empty() instead of set. If the variable is set, but empty, you're going to end up with a query like Prof.State1 IN () which will cause your error, which we would have seen if you'd just posted the query...

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

2004-12-03 Thread Stuart Felenstein
John! Your the man! It works! if (!empty(var)) Excellent. I think this is a good lesson in isset. I assumed they were the same. I guess reading the manual more would help. Thank you. Stuart --- John Holmes [EMAIL PROTECTED] wrote: You need to check if $stateReloc2, etc are empty()

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

2004-12-02 Thread Gryffyn, Trevor
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:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 1:46 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] 5 hours later - sql error.

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

2004-12-02 Thread Stuart Felenstein
--- Gryffyn, Trevor [EMAIL PROTECTED] 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.

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

2004-12-02 Thread John Holmes
Stuart Felenstein wrote: 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. Print out the entire query before you run it. Syntax errors are usually pretty

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

2004-12-02 Thread Bastien Koert
can you post the code that creates the sql statement bastien From: Stuart Felenstein [EMAIL PROTECTED] To: Gryffyn, Trevor [EMAIL PROTECTED], [EMAIL PROTECTED] CC: Stuart Felenstein [EMAIL PROTECTED] Subject: RE: [PHP-DB] 5 hours later - sql error. Date: Thu, 2 Dec 2004 14:50:24 -0800 (PST