Show
Ignore:
Timestamp:
02/10/2008 12:23:51 AM (11 months ago)
Author:
Shadowhand
Message:

Cleaning up some small things in libraries and drivers. Also removed Form_Model and the media controller.

Files:
1 modified

Legend:

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

    r1931 r2016  
    289289        public function field_data($table) 
    290290        { 
    291                 $query  = mysql_query('SHOW COLUMNS FROM '.$this->escape_table($table), $this->link); 
    292  
    293                 $table  = array(); 
    294                 while ($row = mysql_fetch_object($query)) 
    295                 { 
    296                         $table[] = $row; 
    297                 } 
    298  
    299                 return $table; 
     291                $columns = array(); 
     292 
     293                if ($query = mysql_query('SHOW COLUMNS FROM '.$this->escape_table($table), $this->link)) 
     294                { 
     295                        if (mysql_num_rows($query) > 0) 
     296                        { 
     297                                while ($row = mysql_fetch_object($query)) 
     298                                { 
     299                                        $columns[] = $row; 
     300                                } 
     301                        } 
     302                } 
     303 
     304                return $columns; 
    300305        } 
    301306