|
@@ 181-186 (lines=6) @@
|
| 178 |
|
* @param int $limit The number of results you want to return 0 is default and will update all results that match the query, else should be formated as a standard integer
|
| 179 |
|
* @return boolean Returns true if update is successful else returns false
|
| 180 |
|
*/
|
| 181 |
|
public function update($table, $records, $where = array(), $limit = 0){
|
| 182 |
|
unset($this->values);
|
| 183 |
|
$this->sql = sprintf("UPDATE `%s` SET %s %s%s;", $table, $this->fields($records), $this->where($where), $this->limit($limit));
|
| 184 |
|
$this->executeQuery(false);
|
| 185 |
|
return $this->numRows() ? true : false;
|
| 186 |
|
}
|
| 187 |
|
|
| 188 |
|
/**
|
| 189 |
|
* Deletes records from the given table based on the variables given
|
|
@@ 194-199 (lines=6) @@
|
| 191 |
|
* @param array $where This should be an array of for the where statement
|
| 192 |
|
* @param int $limit The number of results you want to return 0 is default and will delete all results that match the query, else should be formated as a standard integer
|
| 193 |
|
*/
|
| 194 |
|
public function delete($table, $where, $limit = 0){
|
| 195 |
|
unset($this->values);
|
| 196 |
|
$this->sql = sprintf("DELETE FROM `%s` %s%s;", $table, $this->where($where), $this->limit($limit));
|
| 197 |
|
$this->executeQuery(false);
|
| 198 |
|
return $this->numRows() ? true : false;
|
| 199 |
|
}
|
| 200 |
|
|
| 201 |
|
/**
|
| 202 |
|
* Count the number of return results
|