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

@@ -121,7 +121,7 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
} // end if (PMA_MYSQL_INT_VERSION >= 32303)
else {
$result = mysql_list_tables($db);
$num_tables = @mysql_numrows($result);
$num_tables = ($result) ? @mysql_numrows($result) : 0;
for ($i = 0; $i < $num_tables; $i++) {
$tables[] = mysql_tablename($result, $i);
}
@@ -638,9 +638,6 @@ if ($num_tables > 0) {
<tr>
<?php
$colspan = '';
// loic1: already defined at the top of the script!
// $tables = mysql_list_tables($db);
// $num_tables = @mysql_numrows($tables);
if ($num_tables > 1) {
$colspan = ' colspan="2"';
echo "\n";