Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Which is the group by function in codeigniter?


Asked by Jaelynn Long on Dec 01, 2021 FAQ



The group_by () method allows you to set the “GROUP BY” clause for your query.You can group by multiple field values using an array. The distinct () function is used to add “DISTINCT” keyword to your query. The having () function allows you to generate “HAVING” clause for your query.
Accordingly,
By using a database class in codeigniter we just need to call group by method. we dont need to write full query. buy using this very easy to do group by on codeigniter The SQL GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups.
Keeping this in consideration, CodeIgniter 'SELECT' query will execute using following functions. They are $sql = "SELECT * FROM tbl_user WHERE name = ? AND type = ?"; $this ->db->query ($sql, array ( 'code', 'php' )); The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:
In respect to this,
Codeigniter Select Query with Multiple Where Condition: You can apply multiple where conditions in a single select query. Below code igniter select query example uses multiple where clause combined with AND keyword.
Next,
CodeIgniter - Common Functions. CodeIgniter library functions and helper functions need to be initialized before they are used but there are some common functions, which do not need to be initialized. These common functions and their descriptions are given below.