Wednesday, 24 August 2016

Codeigniter group by multiple columns

$this->db->group_by()

Permits you to write the GROUP BY portion of your query:

$this->db->group_by("title"); // Produces: GROUP BY title 
 
You can also pass an array of multiple values as well:

$this->db->group_by(array("title", "date"));  // Produces: GROUP BY title, date

No comments:

Post a Comment

Git merge branch to another branch

$ git checkout develop $ git pull $ git checkout test-branch $ git merge develop $ git push