Welcome Guest, Not a member yet? Register   Sign In
Mysql get, where, order by and limit in one.
#3

[eluser]R. Oerlemans[/eluser]
[quote author="BnoL" date="1246160258"]Hi R. Oerlemans,

Firstly, I think you should not fetch your data in views; do it in your models and return the result as an array, and then assign the array to your views. Smile[/quote]

Thanks for the tip, i've solved that.



Code:
/* Data for song block */            
    $songsQuery = $this->db->get('songs'); // Songs query
    $songsQuery = $this->db->where('artist', $getMysql->id); // Where
    $songsQuery = $this->db->order_by('hits'); // Order by
    $songsQuery = $this->db->limit(15); // Limit, 15 entries
    $songsQuery = $this->db->result_array(); // Fetch All

Quote:Fatal error: Call to undefined method CI_DB_mysql_driver::result_array() in *****/application/controllers/artists.php on line 50


Messages In This Thread
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:24 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:37 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:43 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:48 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:52 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 04:58 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 05:08 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 05:12 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 05:16 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 05:20 PM
Mysql get, where, order by and limit in one. - by El Forum - 06-27-2009, 05:24 PM
Mysql get, where, order by and limit in one. - by El Forum - 05-12-2010, 02:43 AM
Mysql get, where, order by and limit in one. - by El Forum - 05-21-2010, 03:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB