Answer the question
In order to leave comments, you need to log in
Fetching join codeigniter count lines?
there are two tables
blogi
id blog_cate
1 batabase
2 batabase
3 razrabotka
4 sql
blog_cate
id blogi_cate_title blogi_cate_url
1 Databases batabase
2 PHP
3 Development razrabotka
Need to make a selection
to be like this
Databases 2
Development 1
PHP 0
<br>
$this->db->select('blogi_cate.*, COUNT(blogi.blog_cate) as num');<br>
$this->db->join('blogi', 'blogi.blog_cate = blogi_cate.blogi_cate_url');<br>
$query = $this->db->get('blogi_cate'); <br>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question