On Wed, Dec 22, 2010 at 8:56 PM, [email protected] <[email protected]> wrote: > > no there is no unique username, this is a social network site with > lots of users ;) I guess,... this still in construction...
If username is not unique your favorites action will never work properly as it's only param is $username. You'll either need to ensure that usernames are unique across your DB or use something else with which to get a particular user's favorites. I haven't gone through all of your code (frankly, it looks like it would benefit from a careful re-write, especially moving quite a lot of it to a model) but, in order to use model::field() you first must set the model's id. The point of field() is to get the column value for a particular row. If the model's id is not set, you can't query that row. I think $parent_id isn't a good choice for variable name here, as you're not dealing with the parent Video of another Video. I assume that it's the User that created the Video, but I'm unsure. 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
