I’m attempting to execute a query with the following format:
$criteria = new CDbCriteria;
$condition_string = ' origin=\''.$input['origin'].'\'';
$condition_string .= ' AND destination=\''.$input['dest'] .'\'';
$criteria->condition = $condition_string;
$pricing = Pricing::model()->with('pricing_routes')->findAll($criteria);
The query should retrieve two records from the database. If I enable logging, copy and paste the query Yii is executing into my db tool. The query retrieves two records, as it should.
The problem I’m having is:
count($pricing_records)
only yields one result. So obviously, when I’m trying to loop through the $pricing array, I’m not getting the appropriate results.
Any idea of what could be going on here? TIA.