I am having difficulty getting Price and Date to display on the webpage.
Below is a section of the current code that I have. The MYSQLI_ASSOC part displays the correct data but the MYSQLI_NUM section of the code does not display at all. I am having trouble finding information on how to make it work.
<?php
$query = "SELECT ItemID, Name, Category, Price, Duration, Photo FROM
item ORDER by ItemID LIMIT 3";
$result = $mysqli->query($query);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_array(MYSQLI_ASSOC)) {
echo "<br> Row: ". $row["ItemID"]. " - Name: ". $row["Name"]. "<br> " . $row["Category"] . "<br>" ;
}
} else {
echo "0 results";
}
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_array(MYSQLI_NUM)) {
echo "<br> Price: ". $row["Price"]. " - Finish Time: ". $row["Duration"]. "<br> ";
}
} else {
echo "0 results";
}
?>