Bug #13783 Updated: odbc_fetch_into different issue

From: Date: Mon, 22 Oct 2001 14:31:58 +0000
Subject: Bug #13783 Updated: odbc_fetch_into different issue
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68708@lists.php.net to get a copy of this message
ID: 13783 Updated by: jpm Reported By: Grant.Walters@walters.co.nz Old Status: Open Status: Feedback Bug Type: ODBC related Operating System: SCO Openserver 5.0.5 & RH Lnux 7 PHP Version: 4.0.6 New Comment: Status -> Feedback Previous Comments: ------------------------------------------------------------------------ [2001-10-22 09:38:15] ahill@php.net Are you getting error messages? Also, please generate an odbc trace; uncomment the DebugFile section in odbc.ini. Best regards, Andrew Hill OpenLink Software ------------------------------------------------------------------------ [2001-10-21 20:59:21] Grant.Walters@walters.co.nz 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 this bug report at http://bugs.php.net/?id=13783&edit=1

« previous php.dev (#68708) next »