Hi
I'm getting an error message :
PDO::errorInfo()Array ( [0] => HY000 [1] => 2014 [2] => Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. )
after scouting about on the interweb, here's one thing I tried with my connection :
try {
$conn = new PDO("mysql:host=$hostname;dbname=esma", $username, $password, array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
// force connection encoding to uft8
$conn->exec('SET CHARACTER SET utf8');
/*** echo a message saying we have connected ***/
op('Connected to database');
}
catch(PDOException $e)
{
op($e->getMessage());
}
I also tried
try {
$conn = new PDO("mysql:host=$hostname;dbname=esma", $username, $password);
$conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
but that gives an additional warning :
Warning: PDO::setAttribute() expects parameter 1 to be long, string given in /home/
the php version is 5.0.44
has anyone got any idea what i can do ?