Welcome Guest, Not a member yet? Register   Sign In
Model View Controller problems
#6

[eluser]jabga[/eluser]
[quote author="saidai jagan" date="1257169905"]use this,
$this->db->insert_id();
It returns the Lat added blog id (must be Primary key).

// second one
$this->Blog_model->get_last_entries();

Use like theis
$this->Blog_model->get_last_entries('10');[/quote]
I used first one, it works! Thanks.

Please, can you answer my last question? It's here
can I insert varuable within this?
$data['query'] = $this->Blog_model->get_last_entries();

For example, How can I show the last $var entries?
It should be like this I think:
$this->Blog_model->get_$NUM_entries();

My model is here
function get_last_ten_entries()
{
$query = $this->db->get('blog', 10);
return $query->result();
}

Maybe it can be like this
function get_last_$NUM_entries()
{
$query = $this->db->get('blog', $NUM);
return $query->result();
}

i would like to be able change function name and number of showing post dynamically


Messages In This Thread
Model View Controller problems - by El Forum - 11-01-2009, 10:14 PM
Model View Controller problems - by El Forum - 11-01-2009, 10:32 PM
Model View Controller problems - by El Forum - 11-01-2009, 10:44 PM
Model View Controller problems - by El Forum - 11-01-2009, 11:19 PM
Model View Controller problems - by El Forum - 11-02-2009, 01:51 AM
Model View Controller problems - by El Forum - 11-02-2009, 01:58 AM
Model View Controller problems - by El Forum - 11-02-2009, 02:10 AM
Model View Controller problems - by El Forum - 11-02-2009, 02:17 AM
Model View Controller problems - by El Forum - 11-02-2009, 02:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB