Hi Friends
am newbies to cakephp please help me. I was reading the e-boook
Cakephp applicaiton Development on page no 89 there is an example
of Magic Find Functions. I dont know why it is not showing me the
result. can
anybody help me i am just stuck in between?
// ************************book_controller.php
<?php
class BooksController extends appController {
var $name = 'Books';
function index() {
$book = $this->Book->findByIsbn('1847192564');
$this->set('books', $books);
}
}
?>
/* **************************index.ctp
<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['Book']['author_name'] ?></td>
</tr>
<?php endforeach; ?>
</table>
// *************** Database / Table Structure
USE `data-access`;
CREATE TABLE `books` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`isbn` varchar( 10 ) NOT NULL ,
`title` varchar( 127 ) NOT NULL ,
`description` text NOT NULL ,
`author_name` varchar( 127 ) NOT NULL
)
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