projectweb
asked on
freetds / unixodbs: Field alias in SQL not working
I have a FreeBSD dedicated server with: Apache 2.0, PHP 5.2, unixODBC and FreeTDS Version 8.0 (0.63) configured that can perfectly connect to a MS SQL Server 2005.
(I work with odbc_connect, odbc_result and so on)
Problem description:
A simple SQL statement like this works fine:
$SQL="SELECT TOP 1 IDPRODUCT FROM PRODUCTS WHERE IDPRODUCT > 5000;"
BUT a bit more complex SQL statement like:
$SQL="SELECT PRODUCTNAME AS NAME FROM PRODUCTS WHERE IDPRODUCTS > 5000;"
Gives me an error like this:
Warning: odbc_result() [function.odbc-result]: Field NAME not found in /home/babyshop/public_html /shop.php on line 198
What is wrong?
Do I use the wrong FreeTDS driver or what could this be?
Thx for your help.
(I work with odbc_connect, odbc_result and so on)
Problem description:
A simple SQL statement like this works fine:
$SQL="SELECT TOP 1 IDPRODUCT FROM PRODUCTS WHERE IDPRODUCT > 5000;"
BUT a bit more complex SQL statement like:
$SQL="SELECT PRODUCTNAME AS NAME FROM PRODUCTS WHERE IDPRODUCTS > 5000;"
Gives me an error like this:
Warning: odbc_result() [function.odbc-result]: Field NAME not found in /home/babyshop/public_html
What is wrong?
Do I use the wrong FreeTDS driver or what could this be?
Thx for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was just a typo.
Sorry for that. (good try, but i'm afraid it isn't that simple)