Changeset 891

Show
Ignore:
Timestamp:
10/25/2007 03:50:45 PM (13 months ago)
Author:
zombor
Message:

Partial fix for #155

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/drivers/Database_Mysql.php

    r864 r891  
    8080        public function delete($table, $where) 
    8181        { 
    82         return 'DELETE FROM '.$this->escape_table($table).' WHERE '.implode(' ', $where); 
     82                return 'DELETE FROM '.$this->escape_table($table).' WHERE '.implode(' ', $where); 
    8383        } 
    8484 
     
    186186                                        if ( ! $this->has_operator($k)) 
    187187                                        { 
    188                                            $k .= ' ='; 
     188                                                $k = $this->escape_column($k).' ='; 
     189                                        } 
     190                                        else 
     191                                        { 
     192                                                // This detect the position of the operator and escape the rest... 
     193                                                //$k = $this->escape_column($k); 
    189194                                        } 
    190195 
     
    242247        public function compile_select($database) 
    243248        { 
    244                 $sql  = ($database['distinct'] == TRUE) ? 'SELECT DISTINCT ' : 'SELECT '; 
     249                $sql = ($database['distinct'] == TRUE) ? 'SELECT DISTINCT ' : 'SELECT '; 
    245250                $sql .= (count($database['select']) > 0) ? implode(', ', $database['select']) : '*'; 
    246251 
     
    311316                        case 'string': 
    312317                                $str = "'".$this->escape_str($str)."'"; 
    313                         break; 
     318                                break; 
    314319                        case 'boolean': 
    315320                                $str = (int) $str;