note 51280 deleted from function.msql-list-tables by didou

From: Date: Mon, 04 Apr 2005 22:06:12 +0000
Subject: note 51280 deleted from function.msql-list-tables by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-87456@lists.php.net to get a copy of this message
Note Submitter: Kinfule at lycos dot es ---- Ah small function to get tables starting with a prefix <? function get_tables($prefix, $dbname) { $result = mysql_list_tables("$dbname"); $num_rows = mysql_num_rows($result); for ($i = 0; $i < $num_rows; $i++) { $table = mysql_tablename($result, $i); $todrop = ereg('^'.$prefix.'_', $table); if ($todrop) { echo "<li>$table</li>"; } } mysql_free_result($result); } ?>

« previous php.notes (#87456) next »