Welcome Guest, Not a member yet? Register   Sign In
Processing a Database Query
#1

[eluser]CodyyC[/eluser]
Hey, I know that there is something wrong with this model.

I was wondering if someone could please tell me whats wrong with it and why etc, so I can learn from what I did wrong.

Thanks in Advanced,
Cody

Here's the model:
Code:
<?php
class Message_read_m extends Model {
    
    var $username = '';
    var $last_message_id = '';
    
    function __construct()
    {
        parent::__construct();
    }
    
    function message_read(){
        
        $this->load->library('session');
        $this->username    = ($this->session->userdata('username')) ? $this->session->userdata('username') : 'Anonymous';
        $this->last_message_id = ($this->session->userdata('last_message_id')) ? $this->session->userdata('last_message_id') : '0';
        $get_messages = $this->db->get('chat_logs', $this->last_message_id);
        $last_message_row = $get_messages->last_row('array');
        $last_message_id = $last_message_row['message_id'];
        $this->session->set_userdata('last_message_id', $this->last_message_id);
        
        return $get_messages->result();
    }
}

?>


Messages In This Thread
Processing a Database Query - by El Forum - 10-03-2010, 12:18 AM
Processing a Database Query - by El Forum - 10-03-2010, 12:41 AM
Processing a Database Query - by El Forum - 10-03-2010, 12:50 AM
Processing a Database Query - by El Forum - 10-03-2010, 01:27 AM
Processing a Database Query - by El Forum - 10-03-2010, 01:44 AM
Processing a Database Query - by El Forum - 10-03-2010, 01:51 AM
Processing a Database Query - by El Forum - 10-03-2010, 02:12 AM
Processing a Database Query - by El Forum - 10-03-2010, 04:07 AM
Processing a Database Query - by El Forum - 10-03-2010, 05:33 AM
Processing a Database Query - by El Forum - 10-03-2010, 04:20 PM
Processing a Database Query - by El Forum - 10-04-2010, 08:14 AM
Processing a Database Query - by El Forum - 10-04-2010, 12:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB