I get this example:
<?php
$shop = array( array( Title => "rose",
Price => 1.25,
Number => 15
),
array( Title => "daisy",
Price => 0.75,
Number => 25,
),
array( Title => "orchid",
Price => 1.15,
Number => 7
)
);
?>
But how can I make one of these with the following structure:
$result2 = mysqli_query($con, "SELECT r.id AS id, CONCAT(g.fname,' ',g.lname) AS name,
r.arrival AS arrival, r.departure AS departure
FROM reservations r JOIN guests g ON r.guest = g.id
WHERE r.unit = ".$unit_id."");
while ($row2 = mysqli_fetch_assoc($result2))
{
$reservations = array( array (id => $row['id'],
name => $row['name'],
arrival => $row['arrival'],
departure => $row['departure'],
));
}