bug 448226

This commit is contained in:
Marc Delisle
2001-08-06 16:25:14 +00:00
parent 52a24c982f
commit a15222421e
2 changed files with 13 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ $Source$
2001-08-06 Marc Delisle <lem9@users.sourceforge.net>
* lib.inc.php3, new code from Loic to avoid showing BLOB
when displaying a TEXT field
* sql.php3, bug 448226 (Missing MySQL messages), correction from Loic.
2001-08-06 Steve Alberty <alberty@nepunlabs.de>
* index.php3: remove warning under Apache 2.0.23-dev

View File

@@ -119,10 +119,19 @@ else {
: '';
$full_sql_query = $sql_query . $sql_order . $sql_limit_to_append;
// Executes the query and gets the number of rows returned
// Executes the query
mysql_select_db($db);
$result = @mysql_query($full_sql_query);
$num_rows = @mysql_num_rows($result);
// Displays an error message if required and stop parsing the script
if (mysql_error()) {
$error = mysql_error();
include('./header.inc.php3');
mysql_die($error, $full_sql_query);
}
// Gets the number of rows returned
$num_rows = mysql_num_rows($result);
// Counts the total number of rows for the same 'SELECT' query without the
// 'LIMIT' clause that may have been programatically added
@@ -140,17 +149,10 @@ else {
$SelectNumRows = mysql_result($OPresult, 0, 'count');
}
} else {
$SelectNumRows = 0;
$SelectNumRows = 0;
}
} // end rows total count
// Displays an error message if required
if (!$result) {
$error = mysql_error();
include('./header.inc.php3');
mysql_die($error);
} // end if
// No rows returned -> move back to the calling page
if ($num_rows < 1) {
if (file_exists('./' . $goto)) {