Doctrine - How to print out the real sql, not just the prepared statement?

后端 未结 19 2444
自闭症患者
自闭症患者 2020-11-30 18:59

We\'re using Doctrine, a PHP ORM. I am creating a query like this:

$q = Doctrine_Query::create()->select(\'id\')->from(\'MyTable\');

19条回答
  •  暖寄归人
    2020-11-30 19:51

    You can use :

    $query->getSQL();
    

    If you are using MySQL you can use Workbench to view running SQL statements. You can also use view the running query from mysql by using the following :

     SHOW FULL PROCESSLIST \G
    

提交回复
热议问题