Codeigniter와 식료품 점에 오류가 발생했습니다. 코드는 다음과 같은 메시지를 던지고 나는 며칠 동안 그것으로 붙어 아래, 나는 총 멍청한 놈이야 : ( 오류 :Codeigniter - 비 객체의 속성을 얻으려고 시도합니다.
PHP는 오류가 발생했습니다
심각도 :주의
메시지 : 비 개체의 속성을 얻으려고 노력
파일 이름 : 컨트롤러/examples.php
줄 번호 : (70)
ps :
함수가 필요하지만 위의 오류가 표시됩니다.
감사합니다.
function security() {
$method = $this->uri->segment(3); //tell ci that we are working on url segment 3, e.g. delete, update ....
if ($method == "edit" or $method == 'update_validation' or $method == 'delete') {
$id = $this->uri->segment(4); //work on url segment 4, now pointing at posts table primary key
$this->db->where('posts.user_id', $this->session->userdata('id'));
$result = $this->db->get_where('posts', array('id' => $id), 1)->row();
//this is line: 70 if ($result->id != $id)
{
echo "You don't have access";
exit;
}
else return true;
}
}
어떤 줄이 70일까요? – kuujo