I have the following code:
$dbh = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbh->
Just to complete the list of possible mistakes causing this issue ... because I was loosing my hair on this I want to share my solution/finding with you.
In my case I've tried to sent several statements to the database with PDO::exec
e.g.
self::$objDatabase->exec( "SELECT id from testtable; UPDATE testtable SET name = 'example';" );
Only 1 SQL Statement in 1 PDO::exec is allowed and save.