ID:               48122
 Updated by:       [email protected]
 Reported By:      theodoreb at goshen dot edu
-Status:           Open
+Status:           Feedback
 Bug Type:         ODBC related
 Operating System: Gentoo Linux
 PHP Version:      5.2.9
 New Comment:

Try this:

<?php
error_reporting(E_ALL);
$conn = odbc_connect("mssql", "login", "passwd",SQL_CUR_USE_ODBC);
var_dump($conn, odbc_errormsg($conn));
$query = "SELECT * FROM tablename";
$cur = odbc_exec($conn,$query);
var_dump(odbc_errormsg($conn));
echo odbc_cursor($cur);
var_dump(odbc_errormsg($conn));
?>



Previous Comments:
------------------------------------------------------------------------

[2009-04-30 16:08:45] theodoreb at goshen dot edu

Description:
------------
odbc_cursor() returns empty string when the connection is created using
odbc_connect() with SQL_CUR_USE_ODBC as the fourth parameter.

Using unixODBC-2.2.12 and freetds-0.82-r2 to connect to Microsoft SQL
Server 2008.

Reproduce code:
---------------
$conn = odbc_connect("mssql", "login", "passwd",SQL_CUR_USE_ODBC);
$query = "SELECT *
            FROM tablename";
$cur = odbc_exec($conn,$query);
echo odbc_cursor($cur);


Expected result:
----------------
cursor name of $cur, something like SQL_CURa70b90

Actual result:
--------------
empty string ''


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48122&edit=1

Reply via email to