#30601 [NEW]: ct_get_data(): user api layer: external error:
| From: | jcastro at elnuevodia dot com | Date: | Thu, 28 Oct 2004 15:27:41 +0000 |
| Subject: | #30601 [NEW]: ct_get_data(): user api layer: external error: | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68435@lists.php.net to get a copy of this message | ||
From: jcastro at elnuevodia dot com
Operating system: Windows Xp
PHP version: 5.0.2
PHP Bug Type: ODBC related
Bug description: ct_get_data(): user api layer: external error:
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
--
Edit bug report at http://bugs.php.net/?id=30601&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30601&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30601&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30601&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30601&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30601&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30601&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30601&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30601&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30601&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30601&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30601&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30601&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30601&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30601&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30601&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30601&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30601&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30601&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30601&r=mysqlcfg