[PHP-DB] Getting total results

2004-12-28 Thread Merlin
Hello everybody, I am trying to split results comming from a mysql db with php into more html pages. Example: Results 1-10 out of 100 Therefor I limit the sql statement with: limit 1, 10 The sql statement is very complex. So far I have always used the same statement but without the limit and wit

Re: [PHP-DB] Getting total results

2004-12-28 Thread John Holmes
Merlin wrote: I am trying to split results comming from a mysql db with php into more html pages. Example: Results 1-10 out of 100 Therefor I limit the sql statement with: limit 1, 10 The sql statement is very complex. So far I have always used the same statement but without the limit and with a

Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
this is a good method, however i created a paging class in php 5 and i believe i still have it here locally in php 4 i will get the link soon :D -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php

Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
http://www.weberdev.com/get_example-4005.html that is the url to the PHP 5 object i created, it was created to show the use of the singleton pattern. This means you can only use this class to have one pager per page. i can edit the code if you do not know how to make it so you can have more than o

Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
php 4 version is posted, let me know if you like it or not. Please keep in mind it is a very basic class, you could extend this in many ways, especially to make the nav bar do something like << 1 2 3 4 25 26 27 28 >> -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] -- PHP Data

Re: [PHP-DB] Getting total results

2004-12-28 Thread John Holmes
Joseph Crawford wrote: http://www.weberdev.com/get_example-4005.html that is the url to the PHP 5 object i created, it was created to show the use of the singleton pattern. This means you can only use this class to have one pager per page. i can edit the code if you do not know how to make it so y

Re: [PHP-DB] Getting total results

2004-12-29 Thread Merlin
Joseph Crawford wrote: php 4 version is posted, let me know if you like it or not. Please keep in mind it is a very basic class, you could extend this in many ways, especially to make the nav bar do something like << 1 2 3 4 25 26 27 28 >> Hi Joseph, thanx for your reply. I do already have s

Re: [PHP-DB] Getting total results

2004-12-29 Thread Joseph Crawford
No problem :D Actually i thought keeping all the data in one query stored in a class was more efficient than a database connection with each page change, however if i am wrong please explain why more database connections is less efficient... -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROT

Re: [PHP-DB] Getting total results

2004-12-29 Thread John Holmes
Joseph Crawford wrote: Actually i thought keeping all the data in one query stored in a class was more efficient than a database connection with each page change, however if i am wrong please explain why more database connections is less efficient... Your class isn't persisting over pages, though,

Re: [PHP-DB] Getting total results

2004-12-29 Thread Joseph Crawford
actually, i was not doing anything with it because it was just the class. The way i use it is that i would store the object in a session variable for use accross pages :D -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubsc