diff options
-rw-r--r-- | it_dbi.class | 6 | ||||
-rw-r--r-- | it_dbi_postgres.class | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/it_dbi.class b/it_dbi.class index f59d779..ee6ce08 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -919,8 +919,8 @@ function escape_string($str) */ function escape_name($str) { - $this->_connect(); - return $this->_escape_name($str); + $this->_connect(); + return $this->_escape_name($str); } /** @@ -1113,7 +1113,7 @@ function _query($query, $p) $this->_connect(array('reconnect' => true)); $result = mysqli_query($this->_link, $query, $p['unbuffered'] ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT); } - } + } $this->_affectedrows = $this->_link->affected_rows; # get_warnings() clobbers this $this->_insertid = mysqli_insert_id($this->_link); # get_warnings() clobbers this diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class index 8fc29f1..2f8eadb 100644 --- a/it_dbi_postgres.class +++ b/it_dbi_postgres.class @@ -62,7 +62,7 @@ function _get_field_defs() $res = $this->query('SELECT * FROM information_schema.columns AS t ' . $where); while ($res && ($field = $this->_fetch_assoc($res))) { $result[$field['column_name']] = ['Field' => $field['column_name'], 'Type' => $field['data_type'], 'Extra' => it::match('^nextval\(', $field['column_default']) ? 'auto_increment' : '', 'Key' => $keys[$field['column_name']]]; - } + } return $result; } @@ -96,7 +96,7 @@ function _query($query, $p) if ($this->_p['keyfield'] && it::match('^INSERT ', $query)) { $isinsert = true; $query .= ' RETURNING ' . $this->_escape_name($this->_p['keyfield']); - } + } if (!($result = pg_query($this->_link, $query)) && $p['safety']) { /* TODO @@ -111,7 +111,7 @@ function _query($query, $p) $result = mysqli_query($this->_link, $query, $p['unbuffered'] ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT); } */ - } + } $this->_affectedrows = pg_affected_rows($result); $this->_insertid = $isinsert ? $this->_fetch_assoc($result)[$this->_p['keyfield']] : 0; |