diff options
author | Derek Allard <derek.allard@ellislab.com> | 2007-12-19 16:01:55 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2007-12-19 16:01:55 +0100 |
commit | e77d77c6b4c094483a3d85b23845436b77796d07 (patch) | |
tree | 616c036495ba4f76aeb9f8f964e0f549980ef691 /system/database/drivers/mysql | |
parent | da6d240d7b8615b5ae628496c42cb216658eb6e4 (diff) |
Added support for limit() into update() and delete() statements in Active Record.
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r-- | system/database/drivers/mysql/mysql_driver.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index aaa9cc635..cd86ebf52 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -463,9 +463,11 @@ class CI_DB_mysql_driver extends CI_DB { * @param array the where clause
* @return string
*/
- function _delete($table, $where)
+ function _delete($table, $where, $limit = FALSE)
{
- return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where);
+ $limit = (!$limit) ? '' : ' LIMIT '.$limit;
+
+ return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit;
}
// --------------------------------------------------------------------
|