Hi, all. I have the following problem with ORM:

I'm learning to use it. I create two tables: books and author, two
models, two controllers, two HTML files. However, when I run books
index.ctp

I got the following error message:

Undefined index:  Author [APP/views/books/index.ctp, line 9]


--index.ctp file ----

<table>
    <thead>
<th>ISBN</th><th>Title</th><th>Author</th>
    </thead>
    <?php foreach($books as $book): ?>
    <tr>
    <td><?php echo $book['Book']['isbn'] ?></td>
    <td><?php echo $book['Book']['title'] ?></td>
    <td><?php echo $book['Author']['name'] ?></td>
    </tr>
    <?php endforeach; ?>
    </table>

 I took this cakePHP code from book named: CakePHP Application
Development edited by Packt publishing.

Any ideas?

TIA

Monico


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

Reply via email to