I have two table, "table1" and "table2". In "table1" is item title and in "table2" is dates and item receive quantity
SQL:
SELECT t2.title, t1.price, t1.quantity, t1.date
FROM table2 t2
JOIN table1 t1
ON t1.id = t2.t_id
WHERE t2.date BETWEEN '2017-07-12' AND '2017-07-15'
Now I get like this result:
title date quantity
item1 2017-07-12 100
item2 2017-07-12 120
item3 2017-07-12 150
item1 2017-07-13 200
item2 2017-07-13 320
item3 2017-07-13 450
But I want get result like this:

now I have this code in PHP:
<?php foreach ($AmmunitionDate as $key => $row): ?>
<tr>
<td> <?=$row['id']?> </td>
<td> <?=$row['title']?> </td>
<td> <?=$row['quantity']?> </td>
<td> </td>
</tr>
<?php endforeach ?>
How can I solve this task?
Thank you