Count how many Databases there are

Asked

Viewed 21 times

0

In the system I am mounting, the Adm Dashboard shows the total number of orders, in which are created Databases for each user and within them, registered the requests by the Tables.

Ex: User 75, has your db pedidos_75 and inside have the tables with the Ids of each request.

The question is, is how to make a selection of Databases and count how many have with the name starting with pedidos, as if it were a SHOW TABLES LIKE "pedidos%" and count?

1 answer

1

Try to do so:

 SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'nomeDoBanco' and TABLE_NAME like '%pedidos%';
  • Thanks for the expensive help, but I decided to create a table and implement some data that would need in other areas of the panel as well.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.