Welcome Guest, Not a member yet? Register   Sign In
Query Advice RESOLVED
#4

[eluser]OES[/eluser]
Ok I think I converted it to an Active Record Query but its obviously wrong.

Code:
$this->db->select("ci_newsentries.*, COUNT(ci_newscomments.newscomment_id) AS no_comments");
$this->db->from('ci_newsentries');
$this->db->join('ci_newscomments', 'ci_newsentries.newsentry_id = ci_newscomments.newscomment_newsentry_id', 'left');
$this->db->where('ci_newsentries.newsentry_approved', 1);
$this->db->group_by("ci_newsentries.newsentry_id");
$this->db->order_by("ci_newsentries.newsentry_id", "desc");
$this->db->limit(10);
$query = $this->db->get();
        
$news_tiems = $query->row_array();
        
print_r($news_items);

but just trying to print the array its obvioulsy not working.

Is the a way to echo the SQL statement to see whats going on ??

Hope you can help


Messages In This Thread
Query Advice RESOLVED - by El Forum - 04-17-2008, 03:40 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 07:11 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 07:24 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 08:12 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 08:16 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 08:22 AM
Query Advice RESOLVED - by El Forum - 04-17-2008, 09:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB