I'm having trouble filtering within a while the data I get from a database. I am writing HTML + PHP generate the layout and to get the sqlite database data.
Table: entries select * from ORDER BY data;
numero nome data
4 Manuel 2018-11-17
6 Rui 2018-11-17
6 Rui 2018-11-17
2 Raul 2018-11-17
2 Raul 2018-11-17
2 Raul 2018-11-17
3 Pedro 2018-11-17
3 Pedro 2018-11-17
2 Raul 2018-11-18
4 Manuel 2018-11-18
6 Rui 2018-11-19
6 Rui 2018-11-19
2 Raul 2018-11-19
2 Raul 2018-11-19
My difficulty is to get HTML and PHP to filter and group the data in this way but with some conditions, if the name and date are the same I create and together in a select menu, if different on the date or name I create a new select menu.
example:
<!DOCTYPE html>
<html>
<body>
<select>
<option value="x">Manuel 2018-11-17</option>
</select>
<select>
<option value="x">Rui 2018-11-17</option>
<option value="x">Rui 2018-11-17</option>
</select>
<select>
<option value="x">Raul 2018-11-17</option>
<option value="x">Raul 2018-11-17</option>
<option value="x">Raul 2018-11-17</option>
</select>
...
<select>
<option value="x">Rui 2018-11-19</option>
<option value="x">Rui 2018-11-19</option>
</select>
...
</body>
</html>