I am following the blog tutorial and modifying it to fit my site's needs. I am having a little trouble with my view function.
function view($id = null)
{
$this->Article->articleid = $id;
$this->set('article', $this->Article->read());
}
This line does not work, I get this error: Warning (512): SQL Error: 1054: Unknown column 'Article.id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 681]
However, I got it to work with $this->set('article', $this->Article->find('first' , array('conditions' => array('Article.articleid' => $id))));
My schema for articles is
- articleid
- userid
- title
- text
The query has WHERE Article
.id
= '1'
however, thats wrong. It should be articleid instead of id
Anyway I can change this so I could use read()?