I'm on zend framework 2.
The scenario is, I want to know the actual SQL query after Zend\\Db\\Sql\\Select
. I cannot use Zend\\Db\\Sql\\SQL
here, and
$select = new Zend\Db\Sql\Select();
$select->where(array($between));
$select->prepareStatement($select)->getSQL();
is giving error like,
Call to a member function getParameterContainer() on null
What is the correct way to write it?
You need to use getSqlString() method.
More info you can find here: https://akrabat.com/displaying-the-generated-sql-from-a-zenddbsql-object/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.