I'm trying to read a row of my table using read()
function and this gives me an error. I've tried to use find('all')
but the same thing happens:
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
Model Article.php
class Article extends AppModel {
function index() {
}
}
Controller ArticlesController.php
class ArticlesController extends AppController {
public $uses = array('Article', 'User');
public function view() {
$id = $this->request->params['id'];
$this->Article->recursive = 3;
$this->Article->id = $id;
$articl = $this->Article->read();
echo count($articl);
exit;
}
}
Can anybody help me please?