hi
i need to join 2 tables. i cannot make it the zend way so i decided to use regular sql, like so. in my model i have this method:
Code:
public function getallposts()
{
$select = "SELECT posts.id,posts.category_id,posts.date,categories.id,categories.title
FROM posts LEFT JOIN categories
ON posts.category_id = categories.id";
$result = $this->fetchAll($select);
return $result;
}
i get this error:
Message: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)
what am i missing here? and maybe someone can help me with the way to join with zend way?
best regards
ron