Welcome Guest, Not a member yet? Register   Sign In
New to Joins and codeigniter
#6

[eluser]liam1412[/eluser]
No it was exactly what I wanted, I modified it slightly to fit my schema but I get an empty result set, apart from all the other bumf codeign gives.

Code:
$data['result'] = $this->db->query('
    SELECT cats.category_name, f.forum_name, COUNT(p.post_id) FROM forum_categories cats
    JOIN forums f ON cats.category_id = f.category_id
    JOIN forum_posts p ON f.forum_id = p.forum_id
    GROUP BY cats.category_name, f.forum_name
    ');
    $this->load->view('homepageview',$data);

Gives

Code:
object(CI_DB_mysql_result)#12 (7) {
  ["conn_id"]=>
  resource(28) of type (mysql link persistent)
  ["result_id"]=>
  resource(29) of type (mysql result)
  ["result_array"]=>
  array(0) {
  }
  ["result_object"]=>
  array(0) {
  }
  ["current_row"]=>
  int(0)
  ["num_rows"]=>
  int(0)
  ["row_data"]=>
  NULL
}


Messages In This Thread
New to Joins and codeigniter - by El Forum - 09-01-2009, 05:09 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 05:29 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 05:47 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 10:55 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 11:00 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 11:13 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 11:28 PM
New to Joins and codeigniter - by El Forum - 09-01-2009, 11:31 PM
New to Joins and codeigniter - by El Forum - 09-02-2009, 11:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB