freetds / unixodbs: Field alias in SQL not working
Posted on 2008-11-04
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)
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.