Originariamente inviato da Zyx147
ok...uso questo codice ma non elimina lo stesso le tabelle desiderate...
$query="SHOW TABLES LIKE 't_%' ";
$result=mysql_query($query, $db);
while($row=mysql_fetch_array($result)){
$query1="DROP TABLE '$row' ";
$result1=mysql_query($query1, $db);}
dove sbaglio???
Daniele ti ha suggerito di concatenare le tabelle e di eseguire una sola query.
Codice PHP:
$tabelle = array();
$query1 = mysql_query("show tables like t_%");
while ($row = mysql_fetch_row($query1)) {
$tabelle[] = $row[0];
}
$tabelle = implode(',',$tabelle);
$query2 = mysql_query("drop table $tabelle");