Skip to content

Commit

Permalink
Fixed bug in transaction load data
Browse files Browse the repository at this point in the history
  • Loading branch information
lillem4n committed Nov 24, 2011
1 parent 065045c commit c00cbb7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/model/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public function __construct($id = NULL, $data = NULL)
}
elseif ($id > 0)
{
$id = (int) preg_replace("/[^0-9]+/", '', $id);
if ($this->load_entry_data($id))
{
$this->id = preg_replace("/[^0-9]+/", '', $id);
$this->id = $id;
}
}
}
Expand Down Expand Up @@ -122,7 +123,7 @@ public function get_id()

private function load_entry_data($id)
{
return ($this->data = $this->pdo->query('SELECT * FROM transactions WHERE id = ?', $id)->fetch(PDO::FETCH_ASSOC));
return ($this->data = $this->pdo->query('SELECT * FROM transactions WHERE id = '.$id)->fetch(PDO::FETCH_ASSOC));
}

}

0 comments on commit c00cbb7

Please sign in to comment.