공지사항 을 구현하기 위해서 작업중입니다.
특별한 방법이 생각이 나지 않아서 .. .
$notice 값 1 넘어 오는데요..
1 넘어 오면 gnum필드에 2000000000을 넣을라고 합니다.
그럼 제일 상단에 노출이 될걸로 믿고 작업하고 있는데...
잘 안되네요...
//공지사항 설정 작업중
if($notice) $this->input->post('gnum') = 2000000000; //97라인
$data = array(
'gnum' => $this->input->post('gnum') ,
'wr_user_id' => $this->session->userdata('username') ,
'nick_name' => $this->input->post('nick_name') ,
//'email' => $this->input->post('email') ,
//'pass' => $this->input->post('pass') ,
'subject' => $this->input->post('subject') ,
'file1' => $uploadfile ,
'content' => $this->input->post('content') ,
'wdate' => date("Y-m-d H:i",time()) ,
'ip' => $this->input->ip_address()
);
$this->db->insert($this->id,$data);
}
에러 내용
Fatal error: Can't use method return value in write context in C:\APM_Setup\htdocs\board_tank\application\models\board_model.php on line 97
웅파//답변 감사 합니다. 공지사항 어제 봐서 ... 아쉽네요 마감되어서...
불의화상//매번 신세 지는것 같네요 ^^ 감사합니다. php기초 없이 CI를 하니까 매번 이런 일이 생기는군요...
아래와 같이 해결 했습니다
이제 제가 만든 게시판에 공지사항을 리스트 상단에 넣을수 있게 되었네요 ㅎㅎㅎ
if($this->input->post('notice')){
$gnum = 2000000000;
}else{
$gnum = $this->input->post('gnum');
};
$data = array(
'gnum' => $gnum ,
'wr_user_id' => $this->session->userdata('username') ,
'nick_name' => $this->input->post('nick_name') ,
//'email' => $this->input->post('email') ,
//'pass' => $this->input->post('pass') ,
'subject' => $this->input->post('subject') ,
'file1' => $uploadfile ,
'content' => $this->input->post('content') ,
'wdate' => date("Y-m-d H:i",time()) ,
'ip' => $this->input->ip_address()
);
$this->db->insert($this->id,$data);
}