| @@ 109-122 (lines=14) @@ | ||
| 106 | return new Mssql_Result(mssql_query($sql, $this->link), $this->link, $this->db_config['object'], $sql); |
|
| 107 | } |
|
| 108 | ||
| 109 | public function escape_table($table) |
|
| 110 | { |
|
| 111 | if (stripos($table, ' AS ') !== false) { |
|
| 112 | // Force 'AS' to uppercase |
|
| 113 | $table = str_ireplace(' AS ', ' AS ', $table); |
|
| 114 | ||
| 115 | // Runs escape_table on both sides of an AS statement |
|
| 116 | $table = array_map(array($this, __FUNCTION__), explode(' AS ', $table)); |
|
| 117 | ||
| 118 | // Re-create the AS statement |
|
| 119 | return implode(' AS ', $table); |
|
| 120 | } |
|
| 121 | return '['.str_replace('.', '[.]', $table).']'; |
|
| 122 | } |
|
| 123 | ||
| 124 | public function escape_column($column) |
|
| 125 | { |
|
| @@ 106-123 (lines=18) @@ | ||
| 103 | $this->query('SET NAMES '.$this->escape_str($charset)); |
|
| 104 | } |
|
| 105 | ||
| 106 | public function escape_table($table) |
|
| 107 | { |
|
| 108 | if (!$this->db_config['escape']) { |
|
| 109 | return $table; |
|
| 110 | } |
|
| 111 | ||
| 112 | if (stripos($table, ' AS ') !== false) { |
|
| 113 | // Force 'AS' to uppercase |
|
| 114 | $table = str_ireplace(' AS ', ' AS ', $table); |
|
| 115 | ||
| 116 | // Runs escape_table on both sides of an AS statement |
|
| 117 | $table = array_map(array($this, __FUNCTION__), explode(' AS ', $table)); |
|
| 118 | ||
| 119 | // Re-create the AS statement |
|
| 120 | return implode(' AS ', $table); |
|
| 121 | } |
|
| 122 | return '`'.str_replace('.', '`.`', $table).'`'; |
|
| 123 | } |
|
| 124 | ||
| 125 | public function escape_column($column) |
|
| 126 | { |
|