Hi bakers!

I have just recently begun using CakePHP, and I'm already convinced
that's it's great! As my first project I followed the CakePHP Blog
tutorial in the Manual. It works just fine, but I'd like to also add
comments to my "blog". I've searched for a tutorial or tip on how to
do this, but have so far been unable to find anything useful.

As a start I added a 'comments' table to my database. Each comment has
an id, author, content and post-id. I also created views for index,
add and view (although I'd only need index and add, right?). I then
created comments_controller.php and my comment model.

It all looks all right but when I browse http://mydomain.com/cake/comments/
I get a:

Not found
The requested address was not found on this server.

So first question is, why?

When I can view comments, how do I link them to a post? Usually, I
would write a query like this:

SELECT author, content, date FROM comments WHERE post = $post_id

After reading some more documentation I found out that I could do this
in my comments_controller.php:

function index($id)
{
   $this->set('comments', $this->Comment->findAll('post = ' . $id));
}

But... because of my first problem I can't really check the result. Am
I in the right direction?

Thanks in advance!


Regards,

Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to