Hi everyone, and thanks for reading. I've a client who will be wanting an events/news section for their website and I have a question about handling this information from a database.
Lets say that the table consisted of:
story_id - To make each story unique. title - The title of the story. story - The actual bulk of the story. date - The date of the story.
I'm wondering how I would go about categorising each of these statements into specific months, I was thinking that instead of having a date field, I'd have a month field with data like "June" or "July", and then use 12 SQL statements to select all from a specific month, but then that isn't reusable when it comes to more than one year (the stories from different years will mix).
So if I was to use a date field i.e. 24/06/08 for each story, then how would I use PHP to separate them into specific months? I know that if I use MySQL to sort them, it'll put them into date order but what I'd want to do is separate them into months.
Also, for things like "the latest five stories" would that be:
"SELECT * FROM table ORDER BY date ASC LIMIT 5"
Thanks very much,