So, i'm creating a money management system. My database has 2 tables: main(id,timestamp,value1,value2) and fields(value1,value2).
Value1 and value2 are the categories in which the money are spent. In fact, the script display a table where the rows are the days and the columns are the fields where the money have been spent into (sport, work, girlfriend, etc).
Now, i have a problem. The main query is this:
SELECT * FROM main WHERE FROM_UNIXTIME(timestamp, '%M %Y') = '$date' ORDER BY timestamp ASC
as you see, i extract data only from the main table. So if i wanna list all the categories contents i have to write manually the category name for each one of them, like this:
echo "<td>".$row['value'] ."€</td>";
echo "<td>".$row['value2'] ."€</td>";
Is there any way it could list all the category name (showing the category content) automatically?