No I dont have a ''ID ' in the database. This is the strcture of my table CREATE TABLE `cvmdl`.`code_categories` ( `CODE_CAT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `CODE_CAT` varchar(45) NOT NULL, `CODE_DESC` varchar(225) DEFAULT NULL, PRIMARY KEY (`CODE_CAT_ID`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
On Dec 11, 3:52 pm, Tilen Majerle <tilen.maje...@gmail.com> wrote: > ofc...have u 'id' field in table in database?...if no, this is problem :D > -- > Tilen Majerlehttp://majerle.eu > > 2010/12/11 Rishi <rishikant...@gmail.com> > > > > > > > > > hi group, > > > I have the following model > > > //file model name: code_category.php > > <?php > > > class CodeCategory extends AppModel { > > > var $name = 'CodeCategory'; > > var $primaryKey = 'CODE_CAT_ID'; // exactly same in db > > } > > ?> > > > when I try to find a row using $this->CodeCategory->findById($id); > > > I have the following error . > > > SQL Error: 1054: Unknown column 'CodeCategory.id' in 'where clause' > > > Can someone please help me. > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c > > om>For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en