I am using PHP 5.2.9 and Apache 2.2.11 and mysql 5.1.32
Why I cannot disable PDO::ATTR_EMULATE_PREPARES ?
Below is the code :
<?php
try{
$conn = new PDO("mysql:host=$DB_SERVER;dbname=$DB_NAME",$DB_USER,$DB_PASS, array(PDO::ATTR_EMULATE_PREPARES => false));
}
catch(PDOException $pe){
die('Connection error : ' .$pe->getMessage());
}
$st = $conn->prepare('abc');
echo "emulate : " . $st->getAttribute(PDO::ATTR_EMULATE_PREPARES);
?>
output is "emulate : 1". I also tried the code :
$conn->setAttribute(PDO::ATTR_EMULATE_PREPARES,false);
but the output is still the same value "1". The output should be 0 if the value is false right? But why the output is 1? How to disable ATTR_EMULATE_PREPARES?