@@ -39,7 +39,7 @@ |
||
| 39 | 39 | // connected database. |
| 40 | 40 | if ($this->conn_id) |
| 41 | 41 | { |
| 42 | - return "SELECT '" . $this->database . "'"; |
|
| 42 | + return "SELECT '".$this->database."'"; |
|
| 43 | 43 | } |
| 44 | 44 | else |
| 45 | 45 | { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $field_names = array(); |
| 66 | 66 | for ($i = 0; $i < $this->num_fields(); $i++) |
| 67 | 67 | { |
| 68 | - $field_names[] = odbc_field_name($this->result_id, $i); |
|
| 68 | + $field_names[] = odbc_field_name($this->result_id, $i); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return $field_names; |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | $retval = array(); |
| 87 | 87 | for ($i = 0; $i < $this->num_fields(); $i++) |
| 88 | 88 | { |
| 89 | - $F = new stdClass(); |
|
| 89 | + $F = new stdClass(); |
|
| 90 | 90 | $F->name = odbc_field_name($this->result_id, $i); |
| 91 | 91 | $F->type = odbc_field_type($this->result_id, $i); |
| 92 | - $F->max_length = odbc_field_len($this->result_id, $i); |
|
| 92 | + $F->max_length = odbc_field_len($this->result_id, $i); |
|
| 93 | 93 | $F->primary_key = 0; |
| 94 | - $F->default = ''; |
|
| 94 | + $F->default = ''; |
|
| 95 | 95 | |
| 96 | 96 | $retval[] = $F; |
| 97 | 97 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $rs_obj = FALSE; |
| 192 | 192 | if (odbc_fetch_into($odbc_result, $rs)) { |
| 193 | 193 | foreach ($rs as $k=>$v) { |
| 194 | - $field_name= odbc_field_name($odbc_result, $k+1); |
|
| 194 | + $field_name = odbc_field_name($odbc_result, $k + 1); |
|
| 195 | 195 | $rs_obj->$field_name = $v; |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | $rs = array(); |
| 213 | 213 | $rs_assoc = FALSE; |
| 214 | 214 | if (odbc_fetch_into($odbc_result, $rs)) { |
| 215 | - $rs_assoc=array(); |
|
| 215 | + $rs_assoc = array(); |
|
| 216 | 216 | foreach ($rs as $k=>$v) { |
| 217 | - $field_name= odbc_field_name($odbc_result, $k+1); |
|
| 217 | + $field_name = odbc_field_name($odbc_result, $k + 1); |
|
| 218 | 218 | $rs_assoc[$field_name] = $v; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $sql .= "\n\t".$this->db->_protect_identifiers($field); |
| 104 | 104 | |
| 105 | - $sql .= ' '.$attributes['TYPE']; |
|
| 105 | + $sql .= ' '.$attributes['TYPE']; |
|
| 106 | 106 | |
| 107 | 107 | if (array_key_exists('CONSTRAINT', $attributes)) |
| 108 | 108 | { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (count($primary_keys) > 0) |
| 145 | 145 | { |
| 146 | 146 | $primary_keys = $this->db->_protect_identifiers($primary_keys); |
| 147 | - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; |
|
| 147 | + $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).")"; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (is_array($keys) && count($keys) > 0) |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $key = array($this->db->_protect_identifiers($key)); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; |
|
| 163 | + $sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).")"; |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | if ($after_field != '') |
| 235 | 235 | { |
| 236 | - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); |
|
| 236 | + $sql .= ' AFTER '.$this->db->_protect_identifiers($after_field); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return $sql; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | // escape LIKE condition wildcards |
| 279 | 279 | if ($like === TRUE) |
| 280 | 280 | { |
| 281 | - $str = str_replace( array('%', '_', $this->_like_escape_chr), |
|
| 281 | + $str = str_replace(array('%', '_', $this->_like_escape_chr), |
|
| 282 | 282 | array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), |
| 283 | 283 | $str); |
| 284 | 284 | } |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return 0; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
| 334 | + $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
| 335 | 335 | |
| 336 | 336 | if ($query->num_rows() == 0) |
| 337 | 337 | { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | $row = $query->row(); |
| 342 | 342 | $this->_reset_select(); |
| 343 | - return (int) $row->numrows; |
|
| 343 | + return (int)$row->numrows; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | // -------------------------------------------------------------------- |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | { |
| 448 | 448 | if (strpos($item, '.'.$id) !== FALSE) |
| 449 | 449 | { |
| 450 | - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); |
|
| 450 | + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item); |
|
| 451 | 451 | |
| 452 | 452 | // remove duplicates if the user already included the escape |
| 453 | 453 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
@@ -531,11 +531,11 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
| 533 | 533 | |
| 534 | - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; |
|
| 534 | + $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : ''; |
|
| 535 | 535 | |
| 536 | 536 | $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); |
| 537 | 537 | |
| 538 | - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; |
|
| 538 | + $sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : ''; |
|
| 539 | 539 | |
| 540 | 540 | $sql .= $orderby.$limit; |
| 541 | 541 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | // escape LIKE condition wildcards |
| 297 | 297 | if ($like === TRUE) |
| 298 | 298 | { |
| 299 | - $str = str_replace( array('%', '_', $this->_like_escape_chr), |
|
| 299 | + $str = str_replace(array('%', '_', $this->_like_escape_chr), |
|
| 300 | 300 | array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), |
| 301 | 301 | $str); |
| 302 | 302 | } |
@@ -330,12 +330,12 @@ discard block |
||
| 330 | 330 | $v = $this->_version(); |
| 331 | 331 | $v = $v['server']; |
| 332 | 332 | |
| 333 | - $table = func_num_args() > 0 ? func_get_arg(0) : NULL; |
|
| 334 | - $column = func_num_args() > 1 ? func_get_arg(1) : NULL; |
|
| 333 | + $table = func_num_args() > 0 ? func_get_arg(0) : NULL; |
|
| 334 | + $column = func_num_args() > 1 ? func_get_arg(1) : NULL; |
|
| 335 | 335 | |
| 336 | 336 | if ($table == NULL && $v >= '8.1') |
| 337 | 337 | { |
| 338 | - $sql='SELECT LASTVAL() as ins_id'; |
|
| 338 | + $sql = 'SELECT LASTVAL() as ins_id'; |
|
| 339 | 339 | } |
| 340 | 340 | elseif ($table != NULL && $column != NULL && $v >= '8.0') |
| 341 | 341 | { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | return 0; |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
| 380 | + $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
| 381 | 381 | |
| 382 | 382 | if ($query->num_rows() == 0) |
| 383 | 383 | { |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | $row = $query->row(); |
| 388 | 388 | $this->_reset_select(); |
| 389 | - return (int) $row->numrows; |
|
| 389 | + return (int)$row->numrows; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | // -------------------------------------------------------------------- |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | { |
| 493 | 493 | if (strpos($item, '.'.$id) !== FALSE) |
| 494 | 494 | { |
| 495 | - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); |
|
| 495 | + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item); |
|
| 496 | 496 | |
| 497 | 497 | // remove duplicates if the user already included the escape |
| 498 | 498 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
@@ -594,11 +594,11 @@ discard block |
||
| 594 | 594 | |
| 595 | 595 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
| 596 | 596 | |
| 597 | - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; |
|
| 597 | + $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : ''; |
|
| 598 | 598 | |
| 599 | 599 | $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); |
| 600 | 600 | |
| 601 | - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; |
|
| 601 | + $sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : ''; |
|
| 602 | 602 | |
| 603 | 603 | $sql .= $orderby.$limit; |
| 604 | 604 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | else |
| 137 | 137 | { |
| 138 | - $sql .= ' '.$attributes['TYPE']; |
|
| 138 | + $sql .= ' '.$attributes['TYPE']; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Modified to prevent constraints with integer data types |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $primary_keys[$index] = $this->db->_protect_identifiers($key); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; |
|
| 183 | + $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).")"; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $sql .= "\n);"; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | foreach ($key as $field) |
| 202 | 202 | { |
| 203 | - $sql .= "CREATE INDEX " . $table . "_" . str_replace(array('"', "'"), '', $field) . "_index ON $table ($field); "; |
|
| 203 | + $sql .= "CREATE INDEX ".$table."_".str_replace(array('"', "'"), '', $field)."_index ON $table ($field); "; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | if ($after_field != '') |
| 269 | 269 | { |
| 270 | - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); |
|
| 270 | + $sql .= ' AFTER '.$this->db->_protect_identifiers($after_field); |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | return $sql; |
@@ -86,12 +86,12 @@ |
||
| 86 | 86 | $retval = array(); |
| 87 | 87 | for ($i = 0; $i < $this->num_fields(); $i++) |
| 88 | 88 | { |
| 89 | - $F = new stdClass(); |
|
| 89 | + $F = new stdClass(); |
|
| 90 | 90 | $F->name = pg_field_name($this->result_id, $i); |
| 91 | 91 | $F->type = pg_field_type($this->result_id, $i); |
| 92 | - $F->max_length = pg_field_size($this->result_id, $i); |
|
| 92 | + $F->max_length = pg_field_size($this->result_id, $i); |
|
| 93 | 93 | $F->primary_key = 0; |
| 94 | - $F->default = ''; |
|
| 94 | + $F->default = ''; |
|
| 95 | 95 | |
| 96 | 96 | $retval[] = $F; |
| 97 | 97 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $sql .= "\n\t".$this->db->_protect_identifiers($field); |
| 105 | 105 | |
| 106 | - $sql .= ' '.$attributes['TYPE']; |
|
| 106 | + $sql .= ' '.$attributes['TYPE']; |
|
| 107 | 107 | |
| 108 | 108 | if (array_key_exists('CONSTRAINT', $attributes)) |
| 109 | 109 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if (count($primary_keys) > 0) |
| 146 | 146 | { |
| 147 | 147 | $primary_keys = $this->db->_protect_identifiers($primary_keys); |
| 148 | - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; |
|
| 148 | + $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).")"; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (is_array($keys) && count($keys) > 0) |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $key = array($this->db->_protect_identifiers($key)); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; |
|
| 164 | + $sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).")"; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | if ($after_field != '') |
| 218 | 218 | { |
| 219 | - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); |
|
| 219 | + $sql .= ' AFTER '.$this->db->_protect_identifiers($after_field); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $sql; |
@@ -86,12 +86,12 @@ |
||
| 86 | 86 | $retval = array(); |
| 87 | 87 | while ($field = mssql_fetch_field($this->result_id)) |
| 88 | 88 | { |
| 89 | - $F = new stdClass(); |
|
| 89 | + $F = new stdClass(); |
|
| 90 | 90 | $F->name = $field->name; |
| 91 | 91 | $F->type = $field->type; |
| 92 | - $F->max_length = $field->max_length; |
|
| 92 | + $F->max_length = $field->max_length; |
|
| 93 | 93 | $F->primary_key = 0; |
| 94 | - $F->default = ''; |
|
| 94 | + $F->default = ''; |
|
| 95 | 95 | |
| 96 | 96 | $retval[] = $F; |
| 97 | 97 | } |