Help with query structure, upcoming events and birthdays (two separate tables) |
[eluser]JamieBarton[/eluser]
Hi folks, Question time! I'm working on a block on my dashboard that is to highlight the <B>5</B> upcoming events and birthdays. The events are stored in a table called 'events' and the birthdays are stored in the user profile, in the field called 'birth_date'. I want to query the database and select all events and birthdays that are upcoming in the 7 days (limiting displaying by 5 remember if there are more than 5) and to show the events in order of the date. When looping through them I want to be able to show the following: http://grab.by/2zhL As you can see the event name is just shown along with an event icon and a birthday icon along with the users name. Can anybody help pushing me in the right lines for this? So far, which I think will need scrapping is the following which just gets events (family_id is another WHERE i need to have in the getting events and users): Code: function get_upcoming_events($family_id, $limit=5, $daystoadd=7) Any help would be greatly appreciated. |
Welcome Guest, Not a member yet? Register Sign In |