Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 718
Ashish Saxena Avatar asked Mar 20 '12 07:03

Ashish Saxena


People also ask

How can I paginate in PHP?

The steps to follow to implement pagination with PHP and MySQL are: STEP1: Create a large-scale database. STEP2: Create a table and insert the list of records in it. STEP3: Create a link for pagination to segregate/distribute the data over several different pages and add it to the bottom of the table created in step 2.

How do you show data in pagination?

Provide a list of records into the table. Connect with the MySQL database. Create the pagination link to split the data on multiple pages and add them to bottom of the table. Fetch data from the database and display it to the multiple pages.

How can I set pagination limit in PHP?

$query = "SELECT * FROM page LIMIT $start, $per_page "; //page bottom, where you want to put your numbers $pages=ceil($num/$per_page); for($s=1; $s<=$pages; $s++) { if($s==$page) $numPage . = "[$s] "; else $numPage . = "<a href='index.


1 Answers

mysql> pager less;

mysql> show tables;

like image 63
ivke Avatar answered Sep 29 '22 10:09

ivke