On Sun, May 11, 2008 at 7:56 AM, (withheld)@gmail.com
<[EMAIL PROTECTED]> wrote:
>
> I know this mailing list must receive a modest amount of praise for
> such a wonderful framework. I don't know a lot about PHP but CakePHP
> makes it easy, just set up the database and bake away.
>
> I recently ran into a problem in one of the cake apps I'm building. It
> is not due to CakePHP.
>
> One of my database tables is called "eagles" and eagles belongs to a
> tournament, now there will be around 20 entries for eagles per
> tournament, at first I thought "no problem, use hasMany" but due to
> complexity ended up just making the table as follows:
>
> id
> created
> modified
> name1
> hole1
> ...
> name20
> hole20
>
> I know this is wrong but it works! I can use a simple hasOne
> relationship hehe.
That may work for now but is not a very robust schema. You should read
up on database normalization. You'll be happy you did so.
> the main thing i had a problem with was pulling up the last 20 records
> of $tournament_id and then in the view printing it out. I was trying
> to use this find statment find('all',array('limit' => '20', 'order' =>
> 'id DESC') but php was just giving me a nice white screen. wierd thing
> is I can just use find('first', array('order' => 'id DESC') no problem
You should check your error log, it might hold a clue. It's possible
that your associations are causing Cake to select too much (or too
many times) and is running out of memory.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---