Bug #13783: odbc_fetch_into different issue
| From: | Grant dot Walters at walters dot co dot nz | Date: | Mon, 22 Oct 2001 00:59:22 +0000 |
| Subject: | Bug #13783: odbc_fetch_into different issue | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68672@lists.php.net to get a copy of this message | ||
From: Grant.Walters@walters.co.nz
Operating system: SCO Openserver 5.0.5 & RH Lnux 7
PHP version: 4.0.6
PHP Bug Type: ODBC related
Bug description: odbc_fetch_into different issue
Platforms:
Using PHP 4.0.6/Openlink 4.1/Progress 8.3D.
Other:
I've tried PHP 4.0.4/4.0.5/4.0.6, Openlink 3.2,4.0,4.1, Progress
8.3C,8.3D,9.1C, shared memory and TCP/IP based connections.
Problem:
Doesn't seem to matter what I do, I am completely unable to select specific
rows using ODBC.
I think the code below is correct, it's snipped from scripts.
<?
$dsn="DSN=$database;UID=$user;PWD=$password";
// I've tried all these without a difference.
$cursor="SQL_CUR_USE_ODBC";
//$cursor="SQL_CUR_IF_NEEDED";
//$cursor="SQL_CUR_USE_DRIVER";
//$cursor="SQL_CUR_DEFAULT";
$sql="SELECT * FROM user_table";
$text="";
function db_fetch_into($id, $number) {
global $text;
$text = "<TD>ROW: $number</TD>";
//Never Returns Anything
//odbc_fetch_into($id, $number, $result_array);
//Always Works
odbc_fetch_into($id, $result_array);
//Always Works
//odbc_fetch_into($id, 0, $result_array);
return $result_array;
}
if ($conn=odbc_connect("$dsn","","","$cursor")){
echo "<TABLE border='1'>";
//while ((odbc_fetch_into($results,$pos,$row)) && ($count<$limit)) {
$pos=0;
while ((list($var1,$var2) = db_fetch_into($result, $pos)) && ($pos<10))
{
echo "<TR>$text<TD>$var1</TD><TD>$var2</TD></TR>";
$pos ++;
}
echo "</TABLE>";
odbc_free_result($result);
odbc_close($conn);
} else {
// No connection .....
}
?>
--
Edit bug report at: http://bugs.php.net/?id=13783&edit=1