I'm adding records to my MySql DB with a time stamp IE: 1107515427
Now when I didplay my page I want it to count the time stamps and show a total for each day ie:
Apr 02 = 32
Apr 03 = 12
ect ect
anyone know how this can be done???
Printable View
I'm adding records to my MySql DB with a time stamp IE: 1107515427
Now when I didplay my page I want it to count the time stamps and show a total for each day ie:
Apr 02 = 32
Apr 03 = 12
ect ect
anyone know how this can be done???
I would actually recommend that you use a MySql Datetime data type and then use a group by query to get the data back.
You can convert a unix time stamp to a MySql date using the following:
The following query will then return a row for each date and the umber of records corresponding to that date:PHP Code:$mysql = date("Y-m-d H:i:s", $unix_timestamp);
Code:SELECT DATE_FORMAT(date_field, "%b %d") Day,Count(*) FROM table_name GROUP BY Day;