odbc and inner joins...
| From: | David W. Jablonski | Date: | Thu, 05 Jul 2001 16:12:56 +0000 |
| Subject: | odbc and inner joins... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10087@lists.php.net to get a copy of this message | ||
I'm trying to use odbc_do with a select statement that uses inner joins.
When I type the Select statement directly into the query window for MSSQL
2000 the query runs fine.
I use the same select statement through odbc
and I get this error: Warning: SQL error: [OpenLink][ODBC][Driver]Syntax
error or access, SQL state 37000 in SQLExecDirect in
/home/httpd/site.somewhere/htdocs/file.php on line 32.
This only happens when I add the inner join on my select statement. If I
don't use a inner join through odbc I can get a connection and a
recordset returned so my connection works fine. I add the inner join and
I get the error. The inner join is joining two tables from the same
database so I'm not even crossing databases.
Here is my select statement: Select Table1.Column1, Table1.Column2 from
Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID;
If I leave out everything after the INNER JOIN the select statement
works. Any help would be much appreciated.
PHP 4.0.4/Apache 1.3.14/Openlink ODBC for
glibc2.1/SQL2000