I am pulling out information from a database and making each row as an object called $row. Then foreach $row I can pull out the information as needed. For e.g. echo $row->date; This works fine. But what I want to do is to put each $row with the same month date into a containing div. E.g all the rows with date = "may" place them into a div called may. I know I could possibly perform multiple database queries but i'm sure there has got to be an easier way then having to do a query for each month. It more logic then the actual code. Any help greatly appreciated.
If you want to limit yourself by just making 1 database call. You could validate it through php code. Convert the mysql date format to php date format (if required). Extract the value of month if month is equal to specific month >>> Assign the specific div id
I think ordering, maybe grouping your select query will be the best way to go, but need some more information. Specficially, how is this going to be displayed? Are months horizontal Jan Feb Mar ..... Or vertical: Jan Feb Mar . . . And what data is going to be displayed with each month? If you can post your current SQL that would help too.