check with your database
(in your table : empty or not empty data ?)

On Thu, Jan 20, 2011 at 8:34 AM, tacoparty <[email protected]> wrote:

> Hello,
>
> I am a complete newbie to PHP and especially CakePHP and am going
> through a few tutorials I found online.
>
> The one I'm having problems with is located here:
> http://www.switchonthecode.com/tutorials/cakephp-using-helpers#comment-6644
>
> I've followed all the steps verbatim but when I try to go to the page
> to see the results it returns two error messages. The table headers
> show up but no data.
>
> Undefined variable: data [APP\views\products\index.ctp, line 14]
>
> Invalid argument supplied for foreach() [APP\views\products\index.ctp,
> line 14]
>
> This is what my controller file looks like:
>
> class ProductsController extends AppController
> {
>  var $name = "Products";
>  var $helpers = array('Html');
>
>  function index()
>  {
>    $data = $this->Product->find('all');
>
>    $this->set('data', $data);
>  }
> }
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to