Nameless12 Posted January 21, 2007 Share Posted January 21, 2007 <?=new html_table_pager('select * from users :limit', 'postgres', 'header goes here')?>The above is my html pager. The first arg is a query or an array of data followed by the database i want to use if i want to use one. My DB Api is configured for multiple dbs so thats why I need that and the header goes here is the table header and that is optional.The table pager extends the html_table and html_table extends html_abstract. html_abstract pretty much turns html into a big object allowing me to use inheritance wherever I want. The pager object is actually separate from the table object that autogens tables based on input. The pager object returns$pager->link;$pager->data;My html_table_pager is just passing the data into the table_autogen and the link into $table->add_footer($pager->link);The table autogen has a mode option and if this mode option is turned on (it is by default) it will show the name of the keys in a header that is below the main header. If the row count is equal to 1 it will appear on the left hand side instead of the top. I was thinking of adding a link there to sort my results easily but because the data is indirect I could only reverse sort or order what is currently inside the table. The problem with this is the data in the table is only what is needed for that one page. Because my pager slices the data up into the limits assigned by my pager script. For examplethe pager will show 5 results for example12345but the total results might be 100, but if i try to reverse it it makes it54321instead of1009998979695I think it will be a big pain to fix this an work around it to add the feature. I am wondering if anyone has done this before and how they did it. And also if anyone thinks I am making a big mistake by leaving the feature out. I will find it kind of annoying leaving it out as i am a perfectionist. But it will just be to much of a head ache to fix I think. Any Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/35094-table-auto-gen-and-paged-data/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.