php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16756 type 'text' fields not retrieved, warning given
Submitted: 2002-04-23 11:14 UTC Modified: 2002-05-13 18:27 UTC
From: h dot vanbrug at syntegra dot nl Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.2.0 OS: Win2000-SP2 + IIS5
Private report: No CVE-ID: None
 [2002-04-23 11:14 UTC] h dot vanbrug at syntegra dot nl
When selecting data from a table with ODBC on a SQL2000 database (latest MDAC + SQL Server drivers version 200.80.528.00 + PHP4.20) a warning is given.

Warning: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index, SQL state S1002 in SQLGetData 

This warning does not appear when using PHP version up to 4.1.0. PHP is configured as a CGI program (ISAPI does not seem to work either!!) The warning appears when using odbc_result(), using both field names and column numbers, example:

$conID=odbc_pconnect($dsn,$usr,$pwd);
$res=odbc_do($conID,"SELECT Fieldname FROM Table")
$var=odbc_result($conID,"Fieldname"); //either this
$var=odbc_result($conID,1);           //or this is used

Further, the data is not retrieved from that field onwards and the data transfer from the server dies. The type of data is the SQL Server type 'text', length is 16. The script has not been modified in any way.

We have taken into account the parameter for odbc_longreadlen()

As far as we understand it, the error seems to indicate that the requested field cannot be found, even though other applications (MS-Access, SQL-Server) and PHP 4.1.0. don't seem to have this problem.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-13 18:26 UTC] kalowsky@php.net
Type TEXT is not a valid ODBC type with ODBC v2.0 systems (which PHP is).

There is work currently underway to enable support for the recent ODBC release (which includes ODBC v3.7 and TEXT support), but at this time it's not generally available.

None the less some of the errors you are seeing have been fixed in 4.2.1 (I believe).  Please try that for the other errors you were seeing, and see if that fixes them.  Sorry about that, but I made a bad change and no one tested it.  
 [2002-05-13 18:27 UTC] kalowsky@php.net
Type TEXT is not a valid ODBC type with ODBC v2.0 systems (which PHP is).

There is work currently underway to enable support for the recent ODBC release (which includes ODBC v3.7 and TEXT support), but at this time it's not generally available.

None the less some of the errors you are seeing have been fixed in 4.2.1 (I believe).  Please try that for the other errors you were seeing, and see if that fixes them.  Sorry about that, but I made a bad change and no one tested it.  

Forgot to mark this closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 03:01:33 2024 UTC