/ Published in: PHP
When working with your model's search function or just grabbing some data with findAll, you can't add an IN condition to your condition clause. Fail:
<code>$criteria->condition = 'start=:startID AND end=:endID AND status IN (1,2,3)';</code>
Instead, use addInCondition:
<code>$criteria->condition = 'start=:startID AND end=:endID AND status IN (1,2,3)';</code>
Instead, use addInCondition:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$criteria = new CDbCriteria(); $criteria->condition = 'start=:startID AND end=:endID'; $results = GraphEdge::model()->findAll($criteria); //OR $theEdge = new GraphEdge();