开发者

use mysql inbuilt functions with cakePHP find()

开发者 https://www.devze.com 2023-01-07 15:15 出处:网络
can any one help me to use the mysql inbuilt f开发者_如何学编程unction in cakePHP?????If you don\'t want to use

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

精彩评论

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