简体   繁体   中英

php zend db profiler INSERT and UPDATE queries

I am trying to use the zend db profiler to record the queries. I read the documentation from the zend website and it works fine except that I am not able to get the values for the insert and the update queries. I just see the query as below with the ? for values. I tried using the getQueryParams to atleast see if I can get the values in the array and it works only with getLastQueryProfile and not the getQueryProfile to get it for all queries. Can some one please let me know how I can get the "?" with the actual values? I am not concerned about the Array as anyways it doesn't do the purpose.

INSERT INTO `myTable` (`id`,  `lname`, `fname`) VALUES (?, ?, ?)

thanks.

I don't think it's possible.

According to php's PDO Manual there's no way to retrieve a query after a prepare() statement. In the examples it's easy to understand because using the PDO manually you know the order of the parameters and have the statement. Looking after Zend clases (Zend_Db_Table_Abstract) i see that the order is maintained and that's the proper way because it uses question mark parameters.

Reading Zend_Db_Adapter_Pdo_* clases you should get it clearer

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM