Dear Friend Posted March 17, 2005 Report Share Posted March 17, 2005 В базе куча всевозможных таблиц. Название некоторых начинается, например, с "blabla_". Все, кроме этих некоторых, надо удалить. Можно это сделать с помощью одного запроса? Link to comment Share on other sites More sharing options...
Shurr Posted March 17, 2005 Report Share Posted March 17, 2005 ИМХО - одним запросом - нельзя. Link to comment Share on other sites More sharing options...
Dear Friend Posted March 17, 2005 Author Report Share Posted March 17, 2005 Я так и подозревал, в принципе... Ну, тогда может подскажете, каким способом это вообще можно сделать через запросы? Link to comment Share on other sites More sharing options...
Darhazer Posted March 17, 2005 Report Share Posted March 17, 2005 при помощю php и MySQL нетрудно: <?php mysql_connect("localhost", "mysql_user", "mysql_password"); $result = mysql_list_tables("mydb"); for ($i = 0; $i < mysql_num_rows($result); $i++) { $table= mysql_tablename($result, $i)); //здес проверяеш име таблици и решаеш удалить ли ее} mysql_free_result($result); ?> Link to comment Share on other sites More sharing options...
Dear Friend Posted March 18, 2005 Author Report Share Posted March 18, 2005 Получилось. Только mysql_tablename не сработала, сделал через mysql_fetch_row. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now