Header menu

_________________________________________________________________________________

Thursday, 12 September 2013

Write sql queries in cakephp controller

How to write sql queries in cakephp controller 

public function index(){
    $result= $this->User->query("SELECT * FROM users ;");  
}

User :- It is the name of my Model
users:- Table name in database

$result:- contain array of result of sql query