Hello,

I was curious as to what's the best way is to find a row's id based
off another field's value.

example:

function sortByGenre($genre_name) {
        $genre = $this->Game->Genre->find('all', array('conditions'=>array
('value'=>$category_name)));
        $genre_id = $genre[0]['Genre']['value'];
}

...Now I know there's got to be a better way.  Does cakePHP have any
convenience functions or any other way to make this simpler?  I have a
feeling I'm approaching this in the completely wrong way.

David
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to