Skip to content

Commit

Permalink
fixed find() error
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Sep 1, 2017
1 parent 18f958c commit 689ce45
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,7 @@ public function get($where_clause = 1)

$query = $this->db_engine->query($queryString);

if (count($query->fetchAll())) {
$this->last_call = $query->fetchAll()[0];
}
$this->last_call = $query->fetchAll()[0];

$this->last_query = $queryString;

Expand Down Expand Up @@ -905,7 +903,6 @@ public function delete($where_clause = false)
$this->triggerEvent('deleting');

$table = $this->getTableName();

if (isset($this->id)) {
$where_clause = "id = '$this->id'";
} elseif (isset($where_clause) && is_numeric($where_clause)) {
Expand All @@ -916,16 +913,13 @@ public function delete($where_clause = false)

$this->last_query = "DELETE FROM `$table` WHERE $where_clause LIMIT 1";

$query = $this->db_engine->prepare("DELETE FROM `$table` WHERE $where_clause LIMIT 1");
// $query->execute();

$query = $this->db_engine->prepare("DELETE FROM `$table` WHERE $where_clause LIMIT 1");

if ($query->execute()) {
$this->triggerEvent('deleted');
} else {
return false;
}

}

public function deleteAll($where_clause = 1)
Expand Down

0 comments on commit 689ce45

Please sign in to comment.