Bug #1039 Updated: odbc_fetch_into( ) doesn't ignore the rownumber parameter if it is not supporte
| From: | Bug Database | Date: | Fri, 08 Jan 1999 05:58:30 +0000 |
| Subject: | Bug #1039 Updated: odbc_fetch_into( ) doesn't ignore the rownumber parameter if it is not supporte | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3392@lists.php.net to get a copy of this message | ||
ID: 1039
User Update by: ccjust@prentice.uq.edu.au
Status: Open
Bug Type: ODBC related
Description: odbc_fetch_into( ) doesn't ignore the rownumber parameter if it is not supporte
All these tests where done on an
- NT4.0 System latest Service Packs
- MSSQL Server 6.5 (Running on the same machine).
- PHP 3.06 Win32 Binary supplied from the PHP website.
This is what odbc_fetch_row currently does.
-------------------------
$status = odbc_fetch_into($q->Query_ID,0,&$testarray);
1. Reads the current row into the array $testarray .
2. Increments the row so that the next call to row 0 is the next record.
This works perfectly.
-------------------------
and
-------------------------
$status = odbc_fetch_into($q->Query_ID,4,&$testarray);
1. Fails due to the fact that specific rows are not available in MSSQL.
This should ignore the rownumber as it is not supported by MSSQL.
--------------------------
Also odbc_fetch_row( ) behaves as follows.
--------------------------
$status = odbc_fetch_row($q->Query_ID);
1. Fetches the current row and moves the cursor/row position forward 1.
Works Perfectly.
--------------------------
$status = odbc_fetch_row($q->Query_ID,5);
1. Fetches the current row.
This does not advance the cursor/row position forward 1.
This may not be a bug but it can cause serious problems with the PHPLib.
If possible can the rownumber be ignored if it not supported and the cursor advanced 1.
---------------------------
In short odbc_fetch_into( ) needs to ignore the rownumber when not supported by the database.
odbc_fetch_row( ) needs to autoincrement the cursor when rownumber is supplied to the function but
not supported by the database.
or
Find a way to have the rownumber working with ODBC and MSSQL 6.5
(I would try if I had the slightest idea where to start and knew how to compile a Win32 binary. :) )
The Code
-------------------------------
$testarray = array();
$status = odbc_fetch_into($q->Query_ID,0,&$testarray);
echo "Stat is -- ".IntVal($status).".";
echo "Here it is -- ".$testarray[1]."<BR>";
$status = odbc_fetch_into($q->Query_ID,4,&$testarray);
echo "Stat is -- ".IntVal($status).".";
echo "Here it is -- ".$testarray[1]."<BR>";
$status = odbc_fetch_into($q->Query_ID,0,&$testarray);
echo "Stat is -- ".IntVal($status).".";
echo "Here it is -- ".$testarray[1]."<BR>";
$status = odbc_fetch_row($q->Query_ID,1);
$value = odbc_result($q->Query_ID,2);
echo "Stat is -- ".IntVal($status).".";
echo "Here it is -- ".$value."<BR>";
$status = odbc_fetch_row($q->Query_ID,3);
$value2 = odbc_result($q->Query_ID,2);
echo "Stat is -- ".IntVal($status).".";
echo "Here it is -- ".$value2."<BR>";
-----------------------------
Returns the results
-----------------------------
Stat is -- 19.Here it is -- Bail
Stat is -- 0.Here it is -- Bail
Stat is -- 19.Here it is -- Cash
Stat is -- 0.Here it is -- Cash
Stat is -- 0.Here it is -- Cash
Full Bug description available at: http://ca.php.net/bugs.php3?id=1039
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net