[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