Google dot what?
Posts: 2
16 credits Members referred : 0
« on: Dec 02, 2007, 03:30:55 pm »
Hi Olaf. thanks for sharing this class. I am new in DB and PHP and this class made my life easier.
I just download the recent version (yesterday I set ed up the one in PHPClasses) and found a problem. The records (as per example) wasn't displaying well. So I changed the funcion page_info as follows:
You can see the "to" parameter was causing this internal string $str not working fine (unless I made some mistake somewhere else (most probably). I changed the internal parameter name to str1 (in order to not modify anything else) and add the $str as direct assignment inside the function.
Just to share this.
Regards,
Guest
« Reply #1 on: Dec 02, 2007, 10:56:48 pm »
is this based on the latest version from my website?
I have this (working) function:
Code:
// this info will tell the visitor which number of records are shown on the current page function page_info($str = "Result: %d - %d of %d") { $first_rec_no = ($this->set_page() * $this->rows_on_page) + 1; $last_rec_no = $first_rec_no + $this->rows_on_page - 1; $last_rec_no = ($last_rec_no > $this->get_total_rows()) ? $this->get_total_rows() : $last_rec_no; $info = sprintf($str, $first_rec_no, $last_rec_no, $this->get_total_rows()); return $info; }
the code on phpclasses.org is not the current version
Google dot what?
Posts: 2
16 credits Members referred : 0
« Reply #2 on: Dec 02, 2007, 11:30:57 pm »
Olaf, I took the code in your page and modified as posted.
The problem I guess is the call to the function page_info("to"); didn't returns anything like Result: 1 - 5 of 25
More clear now?
Regards,
Guest
« Reply #3 on: Dec 03, 2007, 06:06:34 am »
you need to use a string like "Result: %d - %d of %d"
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7411