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


we're using doctrine, php orm. creating query this:

$q = doctrine_query::create()->select('id')->from('mytable'); 

and in function i'm adding in various clauses , things appropriate, this

$q->where('normalisedname = ? or name = ?', array($string, $originalstring)); 

later on, before execute()-ing query object, want print out raw sql in order examine it, , this:

$q->getsqlquery(); 

however prints out prepared statement, not full query. want see sending mysql, instead printing out prepared statement, including ?'s. there way see 'full' query?

doctrine not sending "real sql query" database server : using prepared statements, means :

  • sending statement, prepared (this returned $query->getsql())
  • and, then, sending parameters (returned $query->getparameters())
  • and executing prepared statements

this means there never "real" sql query on php side — so, doctrine cannot display it.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -