![]() |
Hello,
I can't transform my sql request into codeigniter, if someone will help me. Thank you SELECT a.id_article, a.title, a.text FROM articles a JOIN category c ON a.id_category = c.id_category WHERE a.id_article = ( SELECT MIN(a2.id_article) FROM articles a2 WHERE a2.id_category = c.id_category AND c.id_parent = 4 ) GROUP BY c.id_category ORDER BY a.id_article ASC
You could use $db->query().
See https://codeigniter4.github.io/CodeIgnit...ar-queries
for subselect
Code: $builder->where('a.id_article', function(BaseBuilder $builder) { |
Welcome Guest, Not a member yet? Register Sign In |