From: Brion Vibber Date: Sun, 3 Oct 2004 05:59:45 +0000 (+0000) Subject: Extend select() wrapper to allow specifying multiple tables as an array X-Git-Tag: 1.5.0alpha1~1674 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=045e51de386e97851324c167620c0eefb91677d1;p=lhc%2Fweb%2Fwiklou.git Extend select() wrapper to allow specifying multiple tables as an array --- diff --git a/includes/Database.php b/includes/Database.php index a032abccbe..c908196033 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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 );