cakephp get sql query string

To get the SQL query string in CakePHP, you can use the ->sql() method on a CakePHP query object. Here's an example:

$query = $this->ModelName->find();
$sql = $query->sql();

This will return the SQL query string generated by the CakePHP query object.

Please note that the above code assumes you have a model named ModelName and you are using it to perform a query. Replace ModelName with the actual name of your model.