How to apply pagination to the result of SHOW TABLES query in PHP

匿名 (未验证) 提交于 2019-12-03 01:49:02

问题:

I would like to apply pagination to the results of SHOW TABLES FROM DATABASE_NAME.

Tried using the LIMIT keyword but an error is thrown.

By pagination I mean that the result(tables) returned by the query is to be displayed on multiple pages.

回答1:

you can use the different query instead (an achieve the names of the tables) like:

    SELECT TABLE_NAME FROM information_schema.TABLES  WHERE `TABLE_SCHEMA` = 'my_db_name' LIMIT 10 


回答2:

mysql> pager less;

mysql> show tables;



回答3:

You can try following

1)

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES  WHERE TABLE_SCHEMA = 'database_name'  AND TABLE_NAME LIKE "a%"  LIMIT 0,20; 

2)

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES  WHERE TABLE_SCHEMA = 'database_name'   LIMIT 0,50; 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!