[unixODBC-support] Red Hat/MSSQL/PHP odbc_execute parameter binding problem...

Lorenz, Marcus Marcus.Lorenz at unilever.com
Thu Jan 22 12:34:16 GMT 2009


Hello everybody,
 
i have a problem with the odbc_exec function in PHP and i hope i have addressed the right component in the execution chain of this function for my problem. If not please let me know.
 
First our environment:
- Red Hat Enterprise Server 5.2
- unixODBC (Version ? How can i get that)
- FreeTDS stable version available at the 16.12.2008
- MsSQL Server 2005 Enterprise 64Bit.
- PHP ADO DB
 
The problem is, that i can't execute any statements using parameter bindings together with odb_execute. If i include the parameters into the query directly i get the expected results. If i pass them to odbc_execute as an array i only get the following error:
 
odbc_mssql error: [00000: °     ±ÿÂ] in EXECUTE("select  top 1 * from master.Importstatus WHERE importer=? order by id desc")
 
The odbc_prepare() before is executed successfully and returns a valid statement resource.
 
The id 00000 normaly means that the query could be executed successfully (then why is it issuing this error?).
 
This is (a part of) the freetds.config:
[global]
        # TDS protocol version
        tds version = 8.0
 
This is (a part of) the odbc.ini:
 
[ODBC Data Sources]
 
[Default]
Driver          = /usr/local/freetds/lib/libtdsodbc.so

....
 
[MSSQL_Server]
Driver          = FreeTDS

 
I'm developing the same application under my own windows (i have to use it...) environment using the win32 odbc library and everything works fine. When i copy it to the enterprise server using linux i get the descibed error.
 
So any help would be greatly appreciated.
 
Thank you very much.
 
Marcus Lorenz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20090122/84183ae4/attachment.html>


More information about the unixODBC-support mailing list