Optimization - do not call "mysql_numrows", "mysql_results" and "mysql_fetch_array" on invalid queries

This commit is contained in:
Loïc Chapeaux
2002-05-01 12:03:21 +00:00
parent 2ac7b84a33
commit 2e28add87b
13 changed files with 36 additions and 39 deletions

View File

@@ -283,7 +283,7 @@ else {
// Gets the number of rows affected/returned
if (!$is_affected) {
$num_rows = @mysql_num_rows($result);
$num_rows = ($result) ? @mysql_num_rows($result) : 0;
} else if (!isset($num_rows)) {
$num_rows = @mysql_affected_rows();
}
@@ -345,7 +345,7 @@ else {
$goto = 'db_details.php3';
} else {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
if (!@mysql_numrows($is_table)) {
if (!($is_table && @mysql_numrows($is_table))) {
$goto = 'db_details.php3';
unset($table);
}