query($sql); //operations for the results object https://www.php.net/manual/en/class.mysqli-result.php if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "
Item: ". $row["name"] . " Quantity: " . $row["quantity"] . "
"; } } else { echo "0 results"; } ?>