I got syntax even though there wasn’t one
look for right syntax to use near
'WHERE post_id = 1 AND category_id = 1' at line 1.
The SQL statement executed was:
WHERE guide_id = 1 AND category_id = 1
I used
Model::model()->findBySql($sql)
… the $sql u can see above.
I tried to run the sql that was executed directly in phpMyadmin and chive and got no errors, it returned the expected row.
solved it by using…
Model::model()->find('post_id=:post_id AND category_id=:cat_id',
array( ':post_id'=>$model->id,':cat_id'=>$id,
));
…instead but it is more code and more complex for absolutely no reason (in this case)
tested:
xampp
yii 1.1.9
windows 7
firefox