Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 606 Bytes

File metadata and controls

30 lines (22 loc) · 606 Bytes

PHP example of big mount query

$sql = Dog::select('name')->whereAge(0)->toSql();
// 0 is just "empty" value, it doesn't matter here yet

$db = DB::connection()->getPdo();

$query = $db->prepare($sql);
$query->execute(array(10)); // here's our puppies' real age

while ($name = $query->fetchColumn()) {
    // process data
}
  • Yii
$query = Model::find()
			  ->where(['id' => $id])
              ->createCommand()
              ->query();
while ($r = $query->read()) {
  // process data
}