Bug #16742 Updated: odbc_fetch_row fails when parameters 2 set

From: Date: Wed, 24 Apr 2002 12:59:41 +0000
Subject: Bug #16742 Updated: odbc_fetch_row fails when parameters 2 set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-5815@lists.php.net to get a copy of this message
ID: 16742 Updated by: rschuler@psi.de Reported By: badams@ingenico.com.au Status: Open Bug Type: ODBC related Operating System: win2000 sp2 PHP Version: 4.2.0 New Comment: ODBC communication also fail with OS: NT40 (and Apache) No error return!! (work with php 4.1.1) Code: <?php $conn = odbc_connect($dsn, $uid, $pwd) or die( "Error DB connect" ); $sql="SELECT * FROM $dbname ORDER BY dateposted DESC"; if(($result = odbc_exec($conn, $sql))) { $bzm = 1; while(odbc_fetch_row($result, $bzm)) { echo odbc_result($result,"name")."<br>"; $bzm++; } } odbc_free_result($result); ?> Previous Comments: ------------------------------------------------------------------------ [2002-04-23 01:07:46] badams@ingenico.com.au The following code works for the first sql statement however fails on the odbc_fetch_row for the second when the second parmeter is set. This works for php4.1.2 but fails on php4.2.0 ODBC connected to Access97 database, running Apache2 ---------------------------------------------------- CODE ---------------------------------------------------- $DB_TMS = odbc_connect("tms", "", ""); $sql = "select * from users where name='Root' and pass='1111'"; $res = odbc_exec($DB_TMS, $sql); if( odbc_fetch_row($res)) echo "Found Record <br>"; else echo "No Record Found <br> "; odbc_free_result($res); $sql = "select * from users where name='Root' and pass='1111'"; $res = odbc_exec($DB_TMS, $sql); if( odbc_fetch_row($res, 1)) echo "Found Record <br>"; else echo "No Record Found <br> "; odbc_free_result($res); odbc_close_all( ); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16742&edit=1

« previous php.bugs (#5815) next »