Example 1 — Stream Rows Unbuffered
Demo loop with fixed sample rows (no live server).
<?php
$rows = [
['id' => 1, 'name' => 'Ada'],
['id' => 2, 'name' => 'Grace'],
];
foreach ($rows as $row) {
echo $row['id'], ' ', $row['name'], PHP_EOL;
} How It Works
- After real_query, call mysqli_use_result($link).
- Fetch rows one by one without buffering everything first.
- This demo prints stand-in rows instead of talking to MySQL.
- Sample output when connected to a demo database looks the same after fetch_assoc().

