0

Cakephp find data in controller also can with sql syntax,

example :

$this->Post->find('all');

in sql :

select * from posts

convert query to cakephp find syntax is available at http://dogmatic69.com/sql-to-cakephp-find-converter

but whether there is any link for me if I wanna convert my cakephp find to query..

Thanks in advance...

Onesinus Saut
  • 314
  • 5
  • 18

1 Answers1

1

If I got what you are asking, here is the answer

SQL calls that you can’t or don’t want to make via other model
methods can be made using the model’s query() method (though this
should only rarely be necessary).

query() uses the table name in the query as the array key for the returned data, rather than the model name. For example:

$this->POST->query("SELECT* from posts;");

Here is the link for cakephp documentation

Pradeep Singh
  • 1,282
  • 2
  • 19
  • 35