1
0
Fork 0

Rewrite cheat queries to use active record so we can take advantage of the table prefix in config.

This commit is contained in:
Andrew Tomaka 2011-11-11 19:50:51 -05:00
parent 67a25185c7
commit 59ffee0240
2 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ class Fileupload extends CI_Model {
} }
function add_view($id) { function add_view($id) {
$this->db->query("UPDATE uploads SET views = views + 1 WHERE id = $id"); $this->db->where('id',$id)->set('views','views + 1',false)->update('uploads');
} }
function get_uploads($start = false, $count = false) { function get_uploads($start = false, $count = false) {

View file

@ -26,8 +26,8 @@ class Viewer extends CI_Model {
function clean_viewers($duration) { function clean_viewers($duration) {
$clean_time = time() - $duration; $clean_time = time() - $duration;
$this->db->query("DELETE FROM viewers WHERE timestamp < $clean_time"); $this->db->where('timestamp <', $clean_time)->delete('viewers');
} }
} }