bug 448226
This commit is contained in:
@@ -8,6 +8,7 @@ $Source$
|
|||||||
2001-08-06 Marc Delisle <lem9@users.sourceforge.net>
|
2001-08-06 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lib.inc.php3, new code from Loic to avoid showing BLOB
|
* lib.inc.php3, new code from Loic to avoid showing BLOB
|
||||||
when displaying a TEXT field
|
when displaying a TEXT field
|
||||||
|
* sql.php3, bug 448226 (Missing MySQL messages), correction from Loic.
|
||||||
|
|
||||||
2001-08-06 Steve Alberty <alberty@nepunlabs.de>
|
2001-08-06 Steve Alberty <alberty@nepunlabs.de>
|
||||||
* index.php3: remove warning under Apache 2.0.23-dev
|
* index.php3: remove warning under Apache 2.0.23-dev
|
||||||
|
22
sql.php3
22
sql.php3
@@ -119,10 +119,19 @@ else {
|
|||||||
: '';
|
: '';
|
||||||
$full_sql_query = $sql_query . $sql_order . $sql_limit_to_append;
|
$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);
|
mysql_select_db($db);
|
||||||
$result = @mysql_query($full_sql_query);
|
$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
|
// Counts the total number of rows for the same 'SELECT' query without the
|
||||||
// 'LIMIT' clause that may have been programatically added
|
// 'LIMIT' clause that may have been programatically added
|
||||||
@@ -140,17 +149,10 @@ else {
|
|||||||
$SelectNumRows = mysql_result($OPresult, 0, 'count');
|
$SelectNumRows = mysql_result($OPresult, 0, 'count');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$SelectNumRows = 0;
|
$SelectNumRows = 0;
|
||||||
}
|
}
|
||||||
} // end rows total count
|
} // 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
|
// No rows returned -> move back to the calling page
|
||||||
if ($num_rows < 1) {
|
if ($num_rows < 1) {
|
||||||
if (file_exists('./' . $goto)) {
|
if (file_exists('./' . $goto)) {
|
||||||
|
Reference in New Issue
Block a user