|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-07 17:48 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Description: ------------ Short Description : Non returned data with RAD php application (dbqwiksite 3.5) Detail : On a Linux Server with php 4.3.2 and unixODBC driver from EasySoft. The pbm is clearly identified. A php page calls functions in the file qs_functions.php. All parameters to the DB (Oracle) have been verified and correct (connection, select, update ...) When I call the php page on this server no data is returned !!! When I call the same php page on a Windows 2000 server with php 4.3.3, date are returned. When I desactivate the call of the function odbc_fetch_into in the script,data are returned. I think that the call of odbc_fetch_array after the call of odbc_fetch_into triggers this error ! Is it a php bug ? Thank you in advance, it's urgent Reproduce code: --------------- <?php function qsodbc_num_rows($res) { $rowcount = odbc_num_rows($res); if ($rowcount < 0) { $rowcount = 0; while(odbc_fetch_into($res,$fields,1)){ $rowcount++; } } return $rowcount; } function qsodbc_fetch_array($res,$row_num) { $row = array(); $result = array(); if ($row_num > 0) { $result = odbc_fetch_row($res,$row_num); } else { $result = odbc_fetch_row($res); } if ($result) { $nf = odbc_num_fields($res); for($i=0; $i < $nf; $i++) { $field_value = odbc_result($res, $i + 1); $row[$i] = $field_value; } return $row; } } $sql_ext = ""; $conn = odbc_connect("dsn", "user", "pwd"); $sql .= " Select * from table"; if(!$result = @odbc_exec($conn,$sql . " " . $sql_ext)){ $err_string .= "<strong>Erreur</strong> while connecting.<br>" . odbc_errormsg(); } if ($result > 0) {odbc_free_result($result);} $result = odbc_exec($conn,$sql) or die("Invalid query"); $num_rows = qsodbc_num_rows($result); echo "Rows=".$num_rows; while ($row = qsodbc_fetch_array($result,1)) { print "<br>EXT ".$row[1]." * ".$row[2]." * ".$row[3]."<br>"; } odbc_close($conn); ?> Expected result: ---------------- Display of the data Actual result: -------------- No data displayed