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
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
No comments:
Post a Comment