질문 Q #9980
ActiveRecord 오류 ..
비구름 2012-08-10 17:12:56

DB : Informix
컬럼에도 ' 가 붙게 되어 Syntax Error가 납니다. 
어떻게 해결해야 할지 조언부탁드려요 ㅠㅠ

        $this->db->select()->from('table')->where(array('col1'=>1, 'col2' => 'A'),Null,FALSE);

        // 예상쿼리 결과
        // select * from table where col1 = 1 and col2 = 'A'

        // 실제쿼리 결과
        // select * from table where 'col1' = '1' and 'col2' = 'A'

        $this->db->select()->from('table')->where(array('col1'=>1, 'col2' => 'A'),Null,FALSE);

        // 실제쿼리 결과
        // select * from table where col1 = 1 and col2 = A

답변 4
#1 니삼 2012-08-10 18:46:52

$this->db->where('col1', 1);
$this->db->where('col2', 'A');

 where을 2번쓰면 어떨까요?
저도 입문한지 얼마안되서 결과는 잘 모르겠내요
#2 변종원(웅파) 2012-08-13 11:18:49
Null <-- 이 부분이 제대로 작동을 할런지?

NULL로 바꿔서 해보세요. 구문상으로는 이상이 없습니다.

mysql에서는 정상작동하는데 인포믹스 driver 부분의 버그일 수도 있구요.
#3 최화영이 2012-08-14 17:03:40
비구름님 informix 용 드라이버가 있나요?

혹시 있으시다면 부탁드릴수 있을가요?
#4 비구름 2012-08-14 18:00:33
넵, 최화영이님!  pdo를 사용하고요 ~
https://github.com/EllisLab/CodeIgniter/tree/develop/system/database/drivers/pdo/subdrivers

을 참고하였습니다.