By: ViK
Date: 2005-07-13
Time: 14:39
|
data pagination
Hello!
I have been using TBS for a pair of weeks, and I have been a problem. I want to make a mysql query and to show the results in a table, this is not problem, which like me is that it completes page, occupies just like the previous ones, that is to say, if I show 10 lines by page, I want to also show 10 lines in last page, although are not left sufficient records.
Total recs in table: 4
An example:
First page Last Page
+------+ +------+
| Rec1 | | Rec4 |
+------+ +------+
| Rec2 | |empty!|
+------+ +------+
| Rec3 | |empty!|
+------+ +------+ i want this!
but now is show that:
First page Last Page
+------+ +------+
| Rec1 | | Rec4 |
+------+ +------+
| Rec2 |
+------+
| Rec3 |
+------+
some ideas?
thanks!
|
By: Skrol29
Date: 2005-07-14
Time: 02:26
|
Re: data pagination
Hello ViK,
This is not easy to do because it means that you must know the number of total record before to show the last 10 ones. To know the number of record, you must start the query once. To display the records, you must start it another time.
Another way is to save records in a Php array with a FILO (First In - Last Out) stack. But this means you read all data instead of using the LIMIT clause.
So it's quite complicate to do.
|