unsure how to group data from same day. MySQL
Posted: Sat May 17, 2003 12:52 am
Using MySQL.
Allright, I'm making a news script, and I want to group items that are posted on the same day. I normally just do a simple sql query like SELECT * FROM news ORDER BY date DESC LIMIT 0, 15, and then have a loop to print it out. Right now I use a unix timestamp as the date, but since i'm not done with the script, I don't care if I would have to change that.
Basically, I'm trying to get something like at livejournal.com. Where if two items are posted on the same day, then they are posted together. I don't know how to determine if something should be grouped or not.
Allright, I'm making a news script, and I want to group items that are posted on the same day. I normally just do a simple sql query like SELECT * FROM news ORDER BY date DESC LIMIT 0, 15, and then have a loop to print it out. Right now I use a unix timestamp as the date, but since i'm not done with the script, I don't care if I would have to change that.
Basically, I'm trying to get something like at livejournal.com. Where if two items are posted on the same day, then they are posted together. I don't know how to determine if something should be grouped or not.