"'pdoexception' with message 'sqlstate[hy000]: general error: 2014 cannot execute queries while other unbuffered queries are active" Code Answer

2

took a bit of fiddling, but i found that when i took the attr_emulate_prepares=false out (the default is to emulate), it worked:

<?php
$db = new pdo ($cnstring, $user, $pwd);
$db->setattribute (pdo::attr_errmode, pdo::errmode_exception);
//$db->setattribute (pdo::attr_emulate_prepares, false);
$db->setattribute (pdo::mysql_attr_use_buffered_query, true);

$st = $db->query ("create trigger `circlesclosuresync` after insert on circles
for each row begin
    insert into circlesclosure (ancestor, descendant) 
    select ancestor, new.id from circlesclosure where descendant=new.parent;
    insert into circlesclosure (ancestor, descendant) values (new.id, new.id);
end;");

$st->closecursor();
?>

hope this helps someone

By Budius on July 19 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.