Re: Re: Limited db paging with datagrid
| From: | Justin Patrin | Date: | Wed, 05 Jan 2005 02:44:33 +0000 |
| Subject: | Re: Re: Limited db paging with datagrid | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16618@lists.php.net to get a copy of this message | ||
On Wed, 5 Jan 2005 12:47:54 +1100 (EST), daniel@electroteque.org
<daniel@electroteque.org> wrote:
>
> >
> > $result = $db->query("SELECT COUNT(*) AS count FROM users");
> > $record = $result->fetchRow();
> >
> > $result = $db->query("SELECT * FROM users LIMIT 20");
> > $dg->bind($result);
> >
> > $dg->pager->_totalItems = $record['count'];
> >
> >
> > And if you don't like any of these ideas, just create your own paging
> > based on a count query.
> >
> > Hope this helps and let me know what your solution is
>
>
> It also seems that DataGrid doesnt work with MDB ? using this
>
> $data = Structures_DataGrid_DataSource::create($result);
>
> Is there a way to get it to work with MDB , possibly via DataObject ? Does
> ti really need to go into aDataObject though ?
>
DB_DataObject is for DB, not MDB. Ther could be an MDB version, but
noone has had the time to work on it.
In addition, a new PHP extension, PDO, is being worked on (for PHP5)
which handles DB abstraction *natively* in PHP without having to have
an abstraction class. DBDO, which will be a PHP extension version of
DB_DataObject will use this....when it comes out.
--
Justin Patrin