[정보] PDO MySQL 의 prepare emulate 여러분은 모두 속고 있었습니다.

[정보] PDO MySQL 의 prepare emulate 여러분은 모두 속고 있었습니다.



http://kr1.php.net/manual/en/pdo.setattribute.php 


PDO::ATTR_EMULATE_PREPARES Enables or disables emulation of prepared statements. Some drivers do not support native prepared statements or have limited support for them. Use this setting to force PDO to either always emulate prepared statements (if TRUE), or to try to use native prepared statements (if FALSE). It will always fall back to emulating the prepared statement if the driver cannot successfully prepare the current query. Requires bool. 


실제 바인딩이 되는 드라이버인지 구별하지 않고 에뮬레이트 되는 것이 기본 동작입니다. 

직접 false 값을 주기 전엔 속도상의 이득이 전혀 없습니다. 


에뮬레이트 되고 있는지 구별하는 방법 

SELECT * FROM table LIMIT :limit OFFSET :offset 

했을 때 값을 문자열 취급해서 오류납니다. 


License : null