I'm working with Pear MDB2 with PHP 5.3. I'm coding a project that updates a DB and before I let it start changing data, I'd like to see what the SQL queries generated by autoPrepare() and execute() look like before actually executing them.
I plan to create and execute an update query like this:
$stmt = $db->extended->autoPrepare($tableName, $tableColumns,
MDB2_AUTOQUERY_UPDATE, 'id = ' . $db->quote(12345, 'integer'),
$tableColumnTypes));
$res =& $stmt->execute($tableColumnValues);
I already know that I can see the SQL generated by autoPrepare()
with placeholders for the values by accessing $stmt->query
. I'd like to see the completed SQL generated by execute()
, with values substituted for placeholders, without actually sending the query to the DB.
How can I do that?