|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Help with Grouping
I am trying to replicate an Event calendar from the link below with a database driven one however I am having trouble with grouping. I can't seem to get multiple events that occur in the same month to show up under a single month header. if you follow the link below you will see what I am trying to accomplish.
http://internationalsoaringeaglesministries.org/calendar.php Here is what the database version consists of: **Calendar Table CalendarID (int) Primary Key EventDays (varchar) lists the days of the event (ex: 2 - 5) EventDesc (varchar) detail of the event EventLoc (varchar) location of the event Date (TIMESTAMP) date entered into DB Online (TINYINT) is displayed online or not MySQL Statement for Recordset: SELECT * FROM calendar GROUP BY (calendar.Date) In the web page I currently have a single repeat region around the whole calendar area. Also I am using PHP5 and MySQL5 I would be very appreciative if someone could straighten me out here Thanks Dave |
|
#2
|
|||
|
|||
|
RE: Help with Grouping
$result = mysql_query( "select month( date ) as thismonth,date from calendar" );
if( count( $result ) ) { $month = array( ); while( $value = mysql_fetch_assoc( $result ) ) { $month[ $value[ 'thismonth' ] ][] = $value['date']; } foreach( $month as $key => $m ) { echo "month: $key"; foreach( $m as $date ) { echo $date; } } } ----------------------------------------------- I haven't tried this.. Get back to me if there are errors. |
|
#3
|
||||||||
|
||||||||
|
RE: Help with Grouping
I'm afraid that I'm quite the newbie when it comes to coding so I don't really know where or how to impliment your code.
I can post what I do have already and if you would please splain it to me what I need to do. ************************************************** ******** This is the sql for the database with 4 entries for testing: ************************************************** ******** php Code:
************************************************** ******** This is the code for the page with everything striped out: ************************************************** ******** php Code:
Thanks Dave |
|
#4
|
|||
|
|||
|
RE: Help with Grouping
I would really like to know how to add this code in also!
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > Help with Grouping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|