开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜