Menu
Hi,
I seam to be gettin this error when i run this code
error = “Incorrect table name ””
[code=php]
$num = 0;
$show = “SHOW TABLES”;
$show_res = mysql_query($show, $conn) or die(mysql_error());
while($row = mysql_fetch_assoc($show_res)) {
$sql = “DROP TABLE `”.$row[$num].”`”;
mysql_query($sql) or die(mysql_error());
$num++;
}
Am i doing something wrong or is there a better way to drop all tables in a database
P.S i cant name them individualy as they may change!
Thanks
Adam