php - A Database Error Occurred Error Number: 1055 -
changed database mysql mysqli , getting error - database error occurred
error number: 1055
expression #23 of select list not in group clause , contains nonaggregated column 'zipbizzlatestdb.pia.id' not functionally dependent on columns in group clause; incompatible sql_mode=only_full_group_by
select *,o.id id, group_concat(pia.applicantid) applicants `pr_opportunity` o left outer join pr_internal_applicant pia on o.id = pia.positionid o.approval_status='approved' , date(o.deadline) > date(now()) group o.id
filename: /var/www/html/singlecodebase/feb152017/models/mod_common.php
line number: 6999
my model file mod_common below:
function get_opportunity_list() { $sql = "select *,o.id id, group_concat(pia.applicantid) applicants `".$this->mytables['opportunity']."` o left outer join pr_internal_applicant pia on o.id = pia.positionid o.approval_status='approved' , date(o.deadline) > date(now()) group o.id"; $query=$this->db->query($sql); if($query->num_rows() > 0){ $rows = $query->result(); } return $rows; }
no clue how solve error
it occurs in mysql 5.7
check link [https://www.sitepoint.com/quick-tip-how-to-permanently-change-sql-mode-in-mysql/] , follow steps work fine me.
or open file
vi /etc/mysql/my.cnf
add these line @ bottom of file
[mysqld] # ... other stuff here sql_mode = "strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution"
and save restart mysql
sudo service mysql restart
note not window os
Comments
Post a Comment