Structures_DataGrid_DataSource_MDB2 (Previous) (Next) Structures_DataGrid_DataSource_RSS

View this page in Last updated: Sun, 28 Sep 2008
English | French | German | Japanese | Plain HTML

Structures_DataGrid_DataSource_PDO

Structures_DataGrid_DataSource_PDO -- PDO SQL Query Data Source Driver

Description

This class is a data source driver for PHP Data Objects

General notes

You need to specify either a PDO instance or a PDO compatible dsn string as an option to use this driver.

If you use complex queries (e.g. with complex joins or with aliases), $datagrid->getRecordCount() might return a wrong result. For the case of GROUP BY, UNION, or DISTINCT in your queries, and for the case of subqueries, this driver already has special handling. However, if you observe wrong record counts, you need to specify a special query that returns only the number of records (e.g. 'SELECT COUNT(*) FROM ...') as an additional option 'count_query' to the bind() call.

You can specify an ORDER BY statement in your query. Please be aware that this sorting statement is then used in *every* query before the sorting options that come from a renderer (e.g. by clicking on the column header when using the HTML_Table renderer which is sent in the HTTP request). If you want to give a default sorting statement that is only used if there is no sorting query in the HTTP request, then use $datagrid->setDefaultSort().

Structures_DataGrid_DataSource_MDB2 (Previous) (Next) Structures_DataGrid_DataSource_RSS

Download Documentation Last updated: Sun, 28 Sep 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.