Bug #10843: Function creates new array but does not reset pointer
| From: | peter at petermoulding dot com | Date: | Mon, 14 May 2001 03:03:45 +0000 |
| Subject: | Bug #10843: Function creates new array but does not reset pointer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55107@lists.php.net to get a copy of this message | ||
From: peter@petermoulding.com
Operating system: NT 4.0 sp6
PHP version: 4.0.5
PHP Bug Type: ODBC related
Bug description: Function creates new array but does not reset pointer
I tried odbc_fetch_into() in the enclosed loop. I had to inset the reset($array) to get the loop
working. I figure the function is creating new content in the array but not resetting the array
pointer back to the beginning. The function should either
1/ add to the end of the array and increment the pointer
or
2/ replace the contents and reset the pointer.
$sql = "select * from stock";
$result = odbc_exec($connection["vitamins"], $sql);
if($result)
{
print("<br>Result from odbc_fetch_into()" );
$array = "";
while($result_all = odbc_fetch_into($result, 0, $array))
{
reset($array);
print("<br>" );
while(list($k, $v) = each($array))
{
print($v . " ");
}
}
}
else
{
print("<br>No result" );
}
--
Edit Bug report at: http://bugs.php.net/?id=10843&edit=1