|
@@ 106-110 (lines=5) @@
|
| 103 |
|
$params = str_split(str_repeat('?', count($keys))); |
| 104 |
|
|
| 105 |
|
$sql = 'INSERT INTO ' . static::TABLE . ' (' . implode(',', $keys) . ') VALUES (' . implode(', ', $params) . ') '; |
| 106 |
|
if ($this->pdo) { |
| 107 |
|
$this->debug($sql, $values); |
| 108 |
|
$stmt = $this->pdo->prepare($sql); |
| 109 |
|
$stmt->execute($values); |
| 110 |
|
} |
| 111 |
|
return $this->error($stmt); |
| 112 |
|
} |
| 113 |
|
|
|
@@ 126-130 (lines=5) @@
|
| 123 |
|
$values[] = $this->obj->getId(); |
| 124 |
|
|
| 125 |
|
$sql = 'UPDATE ' . static::TABLE . ' SET ' . implode(', ', $params) . ' WHERE ' . static::TABLE . '_id = ? '; |
| 126 |
|
if ($this->pdo) { |
| 127 |
|
$this->debug($sql, $values); |
| 128 |
|
$stmt = $this->pdo->prepare($sql); |
| 129 |
|
$stmt->execute($values); |
| 130 |
|
} |
| 131 |
|
return $this->error($stmt); |
| 132 |
|
} |
| 133 |
|
|