chriss Posted October 4, 2003 Share Posted October 4, 2003 Topic Quote Link to comment https://forums.phpfreaks.com/topic/1112-how-to-drop-all-tables-from-db/ Share on other sites More sharing options...
Barand Posted October 4, 2003 Share Posted October 4, 2003 Quickest way is drop database then recreate it. Quote Link to comment https://forums.phpfreaks.com/topic/1112-how-to-drop-all-tables-from-db/#findComment-3779 Share on other sites More sharing options...
chriss Posted October 5, 2003 Author Share Posted October 5, 2003 I understand, but I have no permission to create/drop db. Quote Link to comment https://forums.phpfreaks.com/topic/1112-how-to-drop-all-tables-from-db/#findComment-3784 Share on other sites More sharing options...
Barand Posted October 5, 2003 Share Posted October 5, 2003 [php:1:c425fae520]<?php $db_name = \'your db name\' ; $cnx = mysql_connect(\'host\' , \'user\' , \'pwd\'); mysql_select_db($db_name); $res = mysql_list_tables($db_name); while ($row = mysql_fetch_row($res)) { $table = $row[0]; echo \"Dropping $table <br>\"; mysql_query(\"DROP TABLE $table\"); } ?>[/php:1:c425fae520] hth Quote Link to comment https://forums.phpfreaks.com/topic/1112-how-to-drop-all-tables-from-db/#findComment-3786 Share on other sites More sharing options...
chriss Posted October 5, 2003 Author Share Posted October 5, 2003 Thank You very much! Quote Link to comment https://forums.phpfreaks.com/topic/1112-how-to-drop-all-tables-from-db/#findComment-3787 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.