php - CodeIgniter sometimes got message query error -


although rare happen, project showing error message in query.

i think happend not because of query.

any suggestion why can happen?

this example of query.

select * (         select rlog.id_issue, created.loguser create_by, created.logtime create_time,r_change.change_by,rlog.tglupt,         r_aprove.date1 aproved_date,issue_type,nama_app,status,kondisi,logact, r_issue.keterangan, logket, param         (select id_issue, logact, max(logtime) tglupt,param, logket r_log group id_issue, logact, logket,param) rlog         inner join (select id_issue, loguser, logtime r_log logact 'add%' ) created on rlog.id_issue = created.id_issue         left join r_change on rlog.id_issue = r_change.id_issue         left join r_aprove on r_change.id_change = r_aprove.id_change         left join r_issue on rlog.id_issue = r_issue.id_issue         inner join r_app_det on r_issue.id_app = r_app_det.id_app         )z issue_type not null         , id_issue = ".$id."         order tglupt, case when logact = 'add' '1' else logact end asc 

this data $query =$this->db->query("select * muser username='".$uname."'"); :

-----------------------------------------   username   |     name        |  role -----------------------------------------     adr      |     andry       |    2     ,      |     andrew      |    4  ------------------------------------------  

-sorry if english bad.

for $uname doesn't result. should check query returns result or not before convert row(). this

$query =$this->db->query("select * muser username='".$uname."'");  if($query->num_rows() == 1){     $query->row(); }else{  //.... } 

Comments