use mysql inbuilt functions with cakePHP find()
can any one help me to use the mysql inbuilt f开发者_如何学编程unction in cakePHP?????
If you don't want to use
$this->Model->query($yoursql);
Then there's still another way for some mysql functions such as concat
,date_format
$this->Model->find($findtype,array('fields'=>array('concat (column1,column2,...) as con','date_format(...) as mydate'),'conditions'=>...));
There is an example of how to use CONCAT in the book. I imagine you would be able to extend the syntax to use the other MySql functions as required.
精彩评论