Hi all,
I am using cakephp 1.26 to create a simple message board in my localhost.
When I tried to link two tables together, I got this error:
Error: Database table posts for model post was not found.
Here are the table structures of the two tables:
Table 'post' has these fields { PostID, Topic, Content}
and table 'reply' has these fields {ReplyID, PostID, CreationDate}
Here is the code of Model site1.php:
<?php
class Site1 extends AppModel {
var $name = 'Site1';
var $useTable = 'post';
var $primaryKey = 'PostID';
var $hasMany = 'Reply';
}
?>
and here is the code of Model reply.php:
<?php
class Reply extends AppModel {
var $name = 'Reply';
var $useTable = 'reply';
var $primaryKey = 'ReplyID';
var $belongsTo ='post';
}
?>
Could you help me solve the problem please?