Permalink
Browse files

Convert a database query.

  • Loading branch information...
1 parent c65cd70 commit cb55eea0f3609d802da5fdb0ea1c8b3acb0b8ea9 @bharat bharat committed Dec 14, 2009
Showing with 5 additions and 4 deletions.
  1. +5 −4 modules/digibug/controllers/digibug.php
@@ -115,9 +115,10 @@ public function close_window() {
}
private function _clean_expired() {
- Database::instance()->query(
- "DELETE FROM {digibug_proxies} " .
- "WHERE request_date <= (CURDATE() - INTERVAL 10 DAY) " .
- "LIMIT 20");
+ db::build()
+ ->delete("digibug_proxies")
+ ->where("request_date", "<=", new Database_Expression("(CURDATE() - INTERVAL 10 DAY)"))
+ ->limit(20)
+ ->execute();
}
}

0 comments on commit cb55eea

Please sign in to comment.