Extend select() wrapper to allow specifying multiple tables as an array
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 3 Oct 2004 05:59:45 +0000 (05:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 3 Oct 2004 05:59:45 +0000 (05:59 +0000)
includes/Database.php

index a032abc..c908196 100644 (file)
@@ -518,10 +518,13 @@ class Database {
                if ( is_array( $vars ) ) {
                        $vars = implode( ',', $vars );
                }
-               if ($table!='')
+               if( is_array( $table ) ) {
+                       $from = ' FROM ' . implode( ',', array_map( array( &$this, 'tableName' ), $table ) );
+               } elseif ($table!='') {
                        $from = ' FROM ' .$this->tableName( $table );
-               else
+               } else {
                        $from = '';
+               }
 
                list( $useIndex, $tailOpts ) = $this->makeSelectOptions( $options );