Rewrite cheat queries to use active record so we can take advantage of the table prefix in config.
This commit is contained in:
parent
67a25185c7
commit
59ffee0240
2 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ class Fileupload extends CI_Model {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -26,8 +26,8 @@ class Viewer extends CI_Model {
|
|||
|
||||
function clean_viewers($duration) {
|
||||
$clean_time = time() - $duration;
|
||||
|
||||
$this->db->query("DELETE FROM viewers WHERE timestamp < $clean_time");
|
||||
|
||||
$this->db->where('timestamp <', $clean_time)->delete('viewers');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue