Custom SQL and Populating Form

2010-12-23 Thread Dan
Here is some code: Model: class Project extends AppModel { var $name = 'Project'; var $primaryKey = 'project_id'; function customFunction($id=0){ $sql = custom sql... where project_id = ?; $params = array( customValidation($id) );

Re: Custom SQL and Populating Form

2010-12-23 Thread cricket
On Thu, Dec 23, 2010 at 8:38 AM, Dan dannyetdi...@gmail.com wrote: Here is some code: Model: class Project extends AppModel {    var $name = 'Project';    var $primaryKey = 'project_id';        function customFunction($id=0){                $sql = custom sql... where project_id = ?;    

Re: Custom SQL and Populating Form

2010-12-23 Thread Dan
So far, I'm simply doing this: $myarr = $this-query($sql, $params, false); return $myarr[0]; I have to figure out what to do when there are no records returned. The index is wrong when that happens. On Dec 23, 2:50 pm, cricket zijn.digi...@gmail.com wrote: On Thu, Dec 23, 2010 at 8:38 AM, Dan