php - mysql query, how to go about it? -


i storing data in mysql database unix time()

i want select data out days, , echo out this:

monday - value tuesday - value wednesday - value thursday - value friday - value saturday - value sunday - value 

value saved in database value times saved in database time

so want select time database in query groups of them day, monday.. mean?

any appreciated.

first, replace integer real datetime column, use mysql's built-in functions group by dayofweek(column)

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

there no advantage storing integer instead of real date. not can convert unix timestamp if need in application, you'd save storage space too.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -