From 516651f2e29196028843933e2c509ba568dd7f42 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Sun, 8 May 2011 20:07:11 +0200 Subject: [PATCH] Use ActiveRecord for get() in project model --- application/models/project.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/project.php b/application/models/project.php index ed7c038..c624d71 100644 --- a/application/models/project.php +++ b/application/models/project.php @@ -92,8 +92,10 @@ class Project extends CI_Model { */ public function get($project_id) { $result = $this->db->get_where('projects', array('id' => $project_id))->row_array(); + $this->db->where('project', $project_id)->update('projects', array( + 'lastaccess' => mysql_now(), + )); - $this->db->query('UPDATE `projects` SET `lastaccess` = NOW() WHERE `id`='.$this->db->escape($project_id).';'); return $result; }