Thursday, December 4, 2008

What is wrong with this line of code?

$answer_count = count($question['Answer']);

I am trying to start learning cakePHP using the book CakePHP
Application Development. I keep getting this error though that points
to this line:

Undefined index: Answer [APP\views\questions\home.ctp, line 10]

In home.ctp, I need to display the number of "Answer" posts. Similar
to Comments for blog posts, but this is Answers for question posts.
Example in the book...but anyways. What is wrong?

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: