RSK
RSK

Reputation: 17516

use mysql inbuilt functions with cakePHP find()

can any one help me to use the mysql inbuilt function in cakePHP?????

Upvotes: 0

Views: 2438

Answers (2)

Young
Young

Reputation: 8356

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'=>...));

Upvotes: 3

Leo
Leo

Reputation: 6571

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.

Upvotes: 0

Related Questions