I have a vbulletin forum where members can add events which are then displayed on a separate page as a list.
I have created a little script to extract the events from the database which works really well.
however, if there are a bunch of event on the same day it prints the date on every event. I would like to display the date on only the first event for that day.
for example, at the moment it's doing this.
Fri 30th Apr - Event 1
Fri 30th Apr - Event 2
Fri 30th Apr - Event 3
Sat 31st Apr - Event 1
Sat 31st Apr - Event 2
Sat 31st Apr - Event 3
I would like it to do this:
Fri 30th Apr - Event 1
...................Event 2
...................Event 3
Sat 31st Apr - Event 1
....................Event 2
....................Event 3
Is it possible using the code below?
The way i've thought about it is..
if date_line is different to previous dateline then *code here without echo dateline* else *code here with date line*
i just don't know how to translate the bit in bold.
$result = mysql_query ("SELECT dateline, dateline_from, eventid, title FROM event WHERE calendarid = 3 AND dateline_from >= '$day_before' ORDER BY dateline_from LIMIT 10");
Question
game_over
I have a vbulletin forum where members can add events which are then displayed on a separate page as a list.
I have created a little script to extract the events from the database which works really well.
however, if there are a bunch of event on the same day it prints the date on every event. I would like to display the date on only the first event for that day.
for example, at the moment it's doing this.
Fri 30th Apr - Event 1
Fri 30th Apr - Event 2
Fri 30th Apr - Event 3
Sat 31st Apr - Event 1
Sat 31st Apr - Event 2
Sat 31st Apr - Event 3
I would like it to do this:
Fri 30th Apr - Event 1
...................Event 2
...................Event 3
Sat 31st Apr - Event 1
....................Event 2
....................Event 3
Is it possible using the code below?
The way i've thought about it is..
if date_line is different to previous dateline then *code here without echo dateline* else *code here with date line*
i just don't know how to translate the bit in bold.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts