I tried to find a solution to my problem, but I'm not quite sure what I’m looking for, so I’m out of luck.
I have a simple MySQL database with one table called "actions". In this table, I have fields for "start_date", "activity_description" and "activity_location".
I am trying to execute a MySQL query using PHP and display the results in ascending order of date, but all actions that drop out on the same date, separated by a header.
For example, I am trying to achieve the following.
2012-05-03
- Take your dog for a walk.
- A park
- Go out for dinner
- Small italian restaurant
2012-05-04
- Get car service
- Johns Auto and Mechanical
2012-05-05
- Shop in stores.
- Go
- MegaPlex
- .
, MQSQL :
$result = mysql_query("SELECT * FROM activities ORDER BY start_date ASC")
, , :
while($row = mysql_fetch_array($result))
{
echo
'<strong>' .
$row['start_date'] .
'</strong>' .
'<ul><li>' .
$row['activity_description'] .
'</li><li>' .
$row['activity_location'] .
'</li></ul>';
}
, :
2012-05-03
2012-05-03
2012-05-04
- Johns Auto and Mechanical
2012-05-05
2012-05-05
2012-05-05
- , "start_date" , , ?
, . .