# Query the database
$dbr = wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
$ns = NS_WHATEVER;
$sql =
"SELECT page_title as title
FROM $page
WHERE page_namespace = $ns
AND page_is_redirect=0
ORDER BY page_title";
$res = $dbr->query( $sql );
# Loop through results
while ($obj = $dbr->fetchObject( $res )) {
// $obj's members map to selected fields
// so $obj->title maps to the `page_title` field, etc
}
-- Jim R. Wilson (jimbojw)
On 7/17/07, Keir <keirlawson(a)gmail.com> wrote:
Hi
I'm trying to code my own MediaWiki extnsion (or rather, heavily
mofdifying
and existing one), and was wondering how I could dynamically, within the
php
code, retrieve a list of all pages in a certain namespace so that I can
then
process them?
Cheers
Keir Lawson
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l