stumped on mysql_num_rows
| From: | Global I.S. S.A. | Date: | Fri, 13 Jun 2003 17:55:46 +0000 |
| Subject: | stumped on mysql_num_rows | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151392@lists.php.net to get a copy of this message | ||
Hello List,
The issue appears to be that no rows are being found with mysql_num_rows using the SQL LIMIT offset.
There should be rows found. Further, all processing just halts, and no query is shown as per the
code here:
// RUN THE QUERY TO RETRIEVE EACH FOUND RECORD
$queryResultHandle = mysql_query($concatquery, $link_identifier) or die ( mysql_error());
// make sure that we recieved some data from our query
$rows = mysql_num_rows ($queryResultHandle);
if ( $rows > 0 ) { // <<<<<<<< THIS IS WHERE THE SCRIPT FAILS
while ($data = mysql_fetch_array ($queryResultHandle)) {
/* /////////////////////////////////////////////////
// COMMON VARIABLE ASSIGNMENT BLOCK - start
$yflastupdate = $data["lastupdate"]; // and other fields too ...
// COMMON VARIABLE ASSIGNMENT BLOCK - end
//////////////////////////////////////////////////// */
include("showOneRecord.php"); // display the row values in a template
} // while
// mysql_free_result ($queryResultHandle);
}else{
echo"<br>Process anomaly. Please try again.<br>";
echo $query;
exit;
}
The result is intermittent failure with the message "Process anomaly. Please try again."
when the first or subsequent "next page" button is clicked. No query shown with the
failure, and a query should be shown.
CONFIGURATION
This issue is experienced intermittently on the developer production site and "always" on
the customer localhost and production sites. The customer is using "I just recently installed
PHP and mySQL so they are pretty close to the latest versions. I think it's PHP 4.3.1 and
mySQL 4.0.13. I get the same error on both the first time I click the "More Results"
button. My browser is IE 6.0.2800 SP1."
What's the problem?
Richard
Information Services
Global I.S. S.A.
info@dreamriver.com
---
Globalissa B2B Websites
http://phpyellow.com
http://www.dreamriver.com