[Mediawiki-l] Pagination in mediawiki

George Alexandru Dudău george.dudau at mobexpert.ro
Tue Dec 15 06:16:08 UTC 2009


Hi everybody,

How can i make pagination from database query in mediawiki? I want to 
show just 25 items on a page.

I make an extension who query database and show in a page the result, 
but are too many (2000 items).
My code is:
"$dbr =& wfGetDB( DB_SLAVE );
$res = $dbr->select( 'tabel', array('id','row1','row2') );
$wgOut->addHTML ("<table>");
$wgOut->addHTML ("<tr><th>ID</th><th>ROW1e</th><th>ROW2</th></tr>");
while ( $row = $dbr->fetchObject( $res ) ) {
$wgOut->addHTML ("<tr><td>" .
     $row->id . "</td><td>" .
         $row->row1 . "</td><td>" .
         $row->row2 . "</td>");
}

The result is:

ID     ROW1    ROW2
1        row1       row2
2        row1        row2
3        row1       row2
...

1000  row1      row2
1001  row1      row2

Please, if you know or you have a link from where i must learn this, 
tell me.

Sorry for my bad english.

Thank you,
Geo

-- 
George Alexandru Dudău
CORE IT MEX - Grupul de firme MOBEXPERT
Network administrator | proiecte web | proiecte speciale

Tel : +40 21 2421040-1139
http://www.itmex.ro




More information about the MediaWiki-l mailing list