chriss Posted October 4, 2003 Share Posted October 4, 2003 Topic 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. 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. 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 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! 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
Archived
This topic is now archived and is closed to further replies.