The code is as follows, where I want to use Pdo_mysql:
use \Zend\Db\Adapter\Adapter;
use \Zend\Db\Sql\Sql;
use \Zend\Db\Sql\Expression;
$params = array(
'driver' => "Pdo_mysql",
'host' => &$this->Registry->config[ 'sql' ][ 'host' ],
'username' => &$this->Registry->config[ 'sql' ][ 'user' ],
'password' => &$this->Registry->config[ 'sql' ][ 'passwd' ],
'dbname' => &$this->Registry->config[ 'sql' ][ 'dbname' ]
);
$this->adapter = new \Zend\Db\Adapter\Adapter( $params );
$this->platform = $this->adapter->getPlatform();
$this->sql = new Sql( $this->adapter );
And when I check the quote character with:
print $this->platform->getQuoteIdentifierSymbol();
As you can see, the double quote is a character. This, of course, invalidates all of my MySQL queries, as it quotes all identifier names (tables, columns, etc.) with double quotes (") instead of direct quotes (`).
So why does the PDO-MySQL driver use the Sql92 character instead? And how to fix it?
source
share