Changeset 2679

Show
Ignore:
Timestamp:
05/20/2008 08:46:08 AM (6 months ago)
Author:
Shadowhand
Message:

Fixing a bug in from() that would prevent "FROM table1, table2" from working properly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Database.php

    r2667 r2679  
    307307        public function from($sql) 
    308308        { 
    309                 foreach ((array) $sql as $val) 
     309                if (func_num_args() > 1) 
     310                { 
     311                        $sql = func_get_args(); 
     312                } 
     313                elseif (is_string($sql)) 
     314                { 
     315                        $sql = explode(',', $sql); 
     316                } 
     317                else 
     318                { 
     319                        $sql = (array) $sql; 
     320                } 
     321 
     322                foreach ($sql as $val) 
    310323                { 
    311324                        if (($val = trim($val)) === '') continue;