Welcome Guest, Not a member yet? Register   Sign In
Question about ORM(Update)
#1

[eluser]InterMedio[/eluser]
Hello everybody.
I wrote model t_activity.php
Code:
class T_activity extends CI_Model {

function last_act($user_id, $current) {
  $this->db->query("UPDATE sessions
        SET last_activity='$current'
        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(user_data, '\"', 4) , '\"', -1)='$user_id'
       ");
}

}
But when I put this method into controller:
Code:
$current_ = time();
$this->t_activity->last_act($current_, $user_id);
this doesn't working.
This working, when I put this sql request in controller.
But I want store this sql query in model.
Anybody can tell me, where can be error or how correct write this request in ORM syntax?
Thanks all.


Messages In This Thread
Question about ORM(Update) - by El Forum - 05-20-2012, 12:14 PM
Question about ORM(Update) - by El Forum - 05-20-2012, 10:44 PM
Question about ORM(Update) - by El Forum - 05-21-2012, 12:28 AM
Question about ORM(Update) - by El Forum - 05-21-2012, 02:03 AM
Question about ORM(Update) - by El Forum - 05-21-2012, 04:09 AM
Question about ORM(Update) - by El Forum - 05-21-2012, 03:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB