| @@ 274-294 (lines=21) @@ | ||
| 271 | * |
|
| 272 | * @return bool|void |
|
| 273 | */ |
|
| 274 | public function insert($table, $query) |
|
| 275 | { |
|
| 276 | $this->db->connect(); |
|
| 277 | $table = $this->db->prefix($table); |
|
| 278 | $query = 'INSERT INTO ' . $table . ' ' . $query; |
|
| 279 | if (!$this->db->queryF($query)) { |
|
| 280 | if (!isset($this->f_tables['insert'][$table])) { |
|
| 281 | $this->f_tables['insert'][$table] = 1; |
|
| 282 | } else { |
|
| 283 | $this->f_tables['insert'][$table]++; |
|
| 284 | } |
|
| 285 | return false; |
|
| 286 | } else { |
|
| 287 | if (!isset($this->s_tables['insert'][$table])) { |
|
| 288 | $this->s_tables['insert'][$table] = 1; |
|
| 289 | } else { |
|
| 290 | $this->s_tables['insert'][$table]++; |
|
| 291 | } |
|
| 292 | return $this->db->getInsertId(); |
|
| 293 | } |
|
| 294 | } |
|
| 295 | ||
| 296 | /** |
|
| 297 | * return the error |
|
| @@ 187-207 (lines=21) @@ | ||
| 184 | return $this->db->fetchArray($ret); |
|
| 185 | } |
|
| 186 | ||
| 187 | function insert($table, $query) |
|
| 188 | { |
|
| 189 | $this->db->connect(); |
|
| 190 | $table = $this->db->prefix($table); |
|
| 191 | $query = 'INSERT INTO ' . $table . ' '. $query; |
|
| 192 | if (!$this->db->queryF($query)) { |
|
| 193 | if (!isset($this->f_tables['insert'][$table])) { |
|
| 194 | $this->f_tables['insert'][$table] = 1; |
|
| 195 | } else { |
|
| 196 | $this->f_tables['insert'][$table]++; |
|
| 197 | } |
|
| 198 | return false; |
|
| 199 | } else { |
|
| 200 | if (!isset($this->s_tables['insert'][$table])) { |
|
| 201 | $this->s_tables['insert'][$table] = 1; |
|
| 202 | } else { |
|
| 203 | $this->s_tables['insert'][$table]++; |
|
| 204 | } |
|
| 205 | return $this->db->getInsertId(); |
|
| 206 | } |
|
| 207 | } |
|
| 208 | ||
| 209 | function isError() |
|
| 210 | { |
|