질문
Q #12437
AR ) get_where null 체크 안되는 문제.
인생초보
2015-08-17 16:56:45
안녕하세요.
CI로 작업중인 사람입니다.
지금 구글링해가면서 찾고있기는 한데요.
이게 버전문제인지 null 체크할때 문제가 발생합니다.
AR 부분입니다.
$this->CI->db->select('access_token')->get_where('oauth_sessions', array('id' => $session_id, 'access_token !=' => NULL));
오류입니다.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
SELECT `access_token` FROM (`oauth_sessions`) WHERE `id` = '2' AND `access_token` !=
access_token != NULL 에서 NULL 을 'NULL' 하면 또 문자열로 인식을 합니다.
혹시 이부분 관련해서 아시는 분 계시면 말씀좀 부탁드리겠습니다.
아니면 ar이 아닌 쿼리로 access_token is not null 이라고 쓰셔야합니다.