php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30601 ct_get_data(): user api layer: external error:
Submitted: 2004-10-28 17:27 UTC Modified: 2005-03-20 18:05 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: jcastro at elnuevodia dot com Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5.0.2 OS: Windows Xp
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-10-28 17:27 UTC] jcastro at elnuevodia dot com
Description:
------------
I am getting the following warning:
Warning: odbc_result(): SQL error: [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_get_data(): user api layer: external error: Item 19 has already been read.,
 SQL state S1000 in SQLGetData in \Inetpub\wwwroot\clasificados\lib\odbcLib.ph
p on line 123

If I just read 18 fields it will NOT GIVE ME A WARNING. It will only appear on field 19 and then it will continue reading without problems. (VIEW OUTPUT)

The problems is bigger than it look. I was using ADODB and for some reason even though a select statement was getting executed I was not getting the data. I remove the adodb code and used the standard odbc code.  That's when I found what I think was causing adodb not to return anything.  I found this by coincidence because I was checking my output with and older system. Otherwise adodb did not report any problems.I nknow you are not responsible for adodb. But this is odbc problems.

I tried 4.3.9 and 5.0.2., same problem. If you try using fetch_array instead of my code it will cause the same error.

I am using Sybase. The table is
CREATE TABLE AdsHomes 
(
    homeID               numeric(10,0) IDENTITY,
    customerCode         char(20)      NOT NULL,
    bedrooms             int           NULL,
    bathrooms            decimal(5,1)  NULL,
    sqfoot               decimal(10,2) NULL,
    price                decimal(15,2) NULL,
    mls                  varchar(50)   NULL,
    homeRefID            varchar(15)   NULL,
    homeTypeID           numeric(3,0)  NULL,
    stories              smallint      NULL,
    lotSize              decimal(10,2) NULL,
    yearBuilt            char(4)       NULL,
    address1             varchar(100)  NULL,
    address2             varchar(100)  NULL,
    city                 varchar(50)   NULL,
    state                char(2)       NULL,
    newspaperTitle       varchar(255)  NULL,
    newspaperText        text          NULL,
    internetText         text          NULL,
    billingLines         tinyint       NULL,
    classificationCode   char(4)       NULL,
    dateCreated          datetime      DEFAULT GETDATE() NOT NULL,
    statNewspaperPubs    int           DEFAULT 0 NULL,
    statInternetPubs     int           DEFAULT 0 NULL,
    statInternetVisits   int           DEFAULT 0 NULL,
    statPhoneCalls       int           DEFAULT 0 NULL,
    nearSchool           char(1)       NULL,
    nearTransit          char(1)       NULL,
    oceanView            char(1)       NULL,
    mountainView         char(1)       NULL,
    applConvOven         char(1)       NULL,
    applDishWasher       char(1)       NULL,
    applElectCookTop     char(1)       NULL,
    applElectOven        char(1)       NULL,
    applGasCookTop       char(1)       NULL,
    applGasOven          char(1)       NULL,
    applElectWaterHeater char(1)       NULL,
    applSolarWaterHeater char(1)       NULL,
    applWaterSofterner   char(1)       NULL,
    applAirConditioner   char(1)       NULL,
    photoCount           smallint      NULL,
    photoPrevIdx         smallint      DEFAULT 0 NULL,
    userID               numeric(10,0) NULL,
    userID2              numeric(10,0) NULL,
    isHidden             char(1)       DEFAULT "N" NULL,
    visualTourPath       varchar(255)  NULL,
    CONSTRAINT AdsHomes_homeID_PK PRIMARY KEY NONCLUSTERED (homeID)
)

Reproduce code:
---------------
$sql = "SELECT * FROM AdsHomes WHERE homeID=75283";

$resultID = odbc_do($this->cn, $sql);
$array = false;
$cols =  odbc_num_fields($resultID);
while(odbc_fetch_row($resultID)) 
{
//        for($i=1;$i<$cols+1;$i++) ORIGINAL CODE
   for($i=1;$i<21;$i++)//FOR TESTING PURPOSES
        $array[odbc_field_name($resultID,$i)] = trim(odbc_result($resultID, $i));
   break;  
}
return $array;


Actual result:
--------------
READING 13
READING 14
READING 15
READING 16
READING 17
READING 18
READING 19

Warning: odbc_result(): SQL error: [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_get_data(): user api layer: external error: Item 19 has already been read.,
 SQL state S1000 in SQLGetData in :\Inetpub\wwwroot\clasificados\lib\odbcLib.ph
p on line 123
READING 20
READING 21
READING 22
READING 23
READING 24
READING 25

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 22:28 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-20 18:05 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC