[Phpmyadmin-devel] Pbs with left.php3

Hi All! Well the current left.php3 script is not really optimized: it always use mysql_list_dbs (even if $cfgServers[n]['only_db'] is set in order to ensure these db trully exists) and this query may requires a huge amount of memory if you're an ISP for example. I've actaully done some tests with the ISP I suscribed to... and this query make fails left.php3 indeed. So I've rewritten a bit this script but I would like some of you to test it before I submit this new version. Lines 21 to 52 have been replaced by: --- new code starts here --- if ($server > 0) { $num_dbs = count($dblist); // 1. $cfgServers[n]['only_db'] exists -> gets the valid databases list if ($num_dbs) { $true_dblist = array(); for ($i = 0; $i < $num_dbs; $i++) { $dblink = @mysql_select_db($dblist[$i]); if ($dblink) { $true_dblist[] = $dblist[$i]; } // end if } // end for unset($dblist); $dblist = $true_dblist; unset($true_dblist); $num_dbs = count($dblist); } // end if // 2. no $cfgServers[n]['only_db'] else { $dbs = mysql_list_dbs() or mysql_die(); $num_dbs = @mysql_num_rows($dbs); for ($i = 0; $i < $num_dbs; $i++) { $dblist[] = mysql_dbname($dbs, $i); } // end for } // end else } else { $num_dbs = 0; } --- end of new code --- Greetz, Loïc ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif

On Wed, Aug 22, 2001 at 12:21:15PM +0200, Loïc wrote:
So I've rewritten a bit this script but I would like some of you to test it before I submit this new version.
seems to work fine here. (but it still show me the list of all db's even if I log as a normal user with std auth: good would be that it only shows "my" db's). Cheers, Olivier -- _________________________________________________________________ Olivier Mueller - om@8304.ch - PGPkeyID: 0E84D2EA - Switzerland qmail projects: http://omail.omnis.ch - http://webmail.omnis.ch
participants (2)
-
Loïc
-
Olivier M.