× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hey Mike
First let me say I'm relatively new to PHP and totally new to CI.
So I have CI loaded and working and connecting to DB2 on the I. I found
a wiki that someone had created a DB2 driver for CI. So I tried to add
pagination to my script. It uses _limit in the db2c_driver which goes
something like this.
function _limit($sql, $limit, $offset = 0)
{
if ($offset == 0)
{
$offset = '';
}
else
{
$offset .= ", ";
}

return $sql."RETURN FIRST " . $limit . " ROWS ONLY";

Of course db2 doesn't support this. I quckly changed the return to
FETCH and I can get results, but I think that is all I can ever get with
this statement.
So I looked at the mysql driver which uses a limit and offset. Again
db2 doesn't support this
So I tried changing myself to this
$sql = "SELECT * FROM (select row_number() over (order by LAST_NAME) as
RN, ID, LAST_NAME,
FIRST_NAME,DEPARTMENT,EXTENSION,PAGER,CELLPHONE#,USERIMAGE
from ". $this->ar_from[0].") x where RN between " . $offset . "
and " . $limit;

The problem is that I can't figure out where I would need to change
these values $offset, &limit, so that on subsequent pages the values
would increase and I would get the next set of records.

I hope this makes sense.



-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Mike Eovino
Sent: Wednesday, September 10, 2008 12:18 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Php and codeigniter


Mike,

I have used CodeIgniter (and love it), but not on the I. What problem
are you having with pagination? I don't monitor this mailbox very
frequently, so please forgive me if I don't respond quickly.

Mike E.

On Mon, Sep 8, 2008 at 2:25 PM, Smith, Mike
<Mike_Smith@xxxxxxxxxxxxxxxx> wrote:
I have been playing with PHP and Codeigniter. I am having problems
with pagination and was wondering if anybody has used Codeignter on
the I?
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.