mysqli_fetch_result-2.php
<?php
$query = "SELECT productid, name, price FROM product ORDER BY name";
$result = $mysqli->query($query);
while ($row = $result->fetch_array(MYSQLI_NUM))
{
$productid = $row[0];
$name = $row[1];
$price = $row[2];
echo "($productid) $name: $price <br />";
}
?>
Related examples in the same category