summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-10-22 02:25:17 +0100
committerJamie Matthews <[email protected]>2010-10-22 02:25:17 +0100
commit234a748983213403120447a81ab3bdda62908c2f (patch)
treea53ca0d7312f9912619806768b7191ff374976b8 /idiorm.php
parent0a01caf89048cbac58b144029fab2465722cc59c (diff)
find_one method now adds LIMIT 1 to queries
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/idiorm.php b/idiorm.php
index 58a67ae..0402652 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -306,6 +306,7 @@
if(!is_null($id)) {
$this->where($this->_get_id_column_name(), $id);
}
+ $this->limit(1);
$this->_find_type = self::FIND_ONE;
$statement = $this->_run();
$result = $statement->fetch(PDO::FETCH_ASSOC);