I’m running a query like this
$sql = "REPLACE INTO accommodations SET city_id=:city_id WHERE id =:id"; $connection = Yii::app()->db; $command = $connection->createCommand($sql); $command->bindParam(":id", $row["Id"], PDO::PARAM_INT); $command->bindParam(":city_id", $row["ParentId"], PDO::PARAM_INT); $command->execute();
I’d like to output the generated query before it is executed, so I’m sure all the values are properly binded…
How do I do that? I know it’s possible to use logging when it executes, but I’m just looking for a quick way to show the query. Is there a method for it?