3064 Posts in 865 Topics by 647 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 983 Views |
-
how paginate my query result???

17 February 2009 at 4:20am Last edited: 17 February 2009 4:20am
Hi!
please helm me..I read guide about search form and I see how paginate serch result http://doc.silverstripe.org/doku.php?id=tutorial:4-site-search
Now I have a function Conn() that take data from external database (243). I need show 10 result for page. Function that count page number work good (25 pages), but all my data(243) are show in all 25 pages, so they aren't sort in my 25 pages.this is my function:
function Conn()
{ global $db_pandora;
$record=$db_pandora->query('SELECT * FROM mm_ville');
$rec=array();
while($rec[]=$record->nextRecord())
{
}
$doSet = new DataObjectSet();
foreach($rec as $key)
{
$record = array(
'Id' => $key['id'],
'Nome' => $key['name'],
);
$doSet->push(new ArrayData($record));}
return $doSet;
}
-
Re: how paginate my query result???

21 March 2009 at 1:05am
Have you had a look at this - http://doc.silverstripe.com/doku.php?id=private:recipes:pagination
| 983 Views | ||
|
Page:
1
|
Go to Top |

