Cakephp Model Fetch query Retrieve data from database $this->Resume->find('first',array('contain'=>array('ResumeSkill'=>array('Skill'=>array('name'), 'conditions'=>array('ResumeSkill.skill_id !='=>''))), 'conditions'=>array('Resume.user_id'=>$user_id),'order'=>'Resume.modified DESC')); $this->Layout->query("SELECT *,if(sort IS NULL,0,sort) as sort1 FROM `layouts` AS Layout WHERE `user_id` LIKE '".$user_id."' && Layout.active=1 ORDER BY (`sort1`>0) DESC,(`sort1`) ASC"); $this->Invoice->find('first',array('fields'=>array('*','curdate() as curdate','DATE_FORMAT(plan_start_date,"%Y-%m-%d") as plan_start_date1'), 'conditions'=>array('Invoice.id'=>$last_invoice_id,'Invoice.user_id'=>$this->Auth->user('id') ,...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.