created three tables, one for events (tblevents), one for holiday or
"plus" events, and a table for special events (tblspevents). Here are
the basic layouts (db is MySQL 3.23 [why can't my host upgrade?....]):
tblevents:
intEventsID int(11) unsigned auto_increment
intEventDatesID int(11)
dtStartTime time
dtEndTime time
intEntLocID int(11)
intEntTypeID int(11)
intEntID int(11)
dtUpdated timestamp
tblspevents:
intSpEventsID int(11) unsigned auto_increment
intEventDatesID int(11)
dtStartTime time
dtEndTime time
txtSpEventsTitle varchar(255)
txtSpEventsDesc text
dtUpdated timestamp
tblholidayplus:
intHolidayPlusID int(11) unsigned auto_increment
dtStartDate date
dtEndDate date
txtHolidayPlusTitle varchar(255)
txtHolidayPlusDesc varchar(255)
txtHolidayPlusURL varchar(255)
dtUpdated timestamp
As you might see, the top two tables (tblevents and tblspevents) are
tied to another table (tbleventdates) by that tables pk
(intEventDatesID). Here is its general layout:
tbleventdates:
intEventDatesID int(11) unsigned auto_increment
dtDates date
blSpEvent tinyint(3)
Using a backend editor, if I place an item into either the events or
special events table it will:
a. check to see if that date is already in my event dates table
(tbleventdates)
b. if so it will use it's ID for the ref, if not it will write a new
record to the event dates table and then use that ID
Here is the issue that I have with the three top tables. I need to
1. pull all records from the events table (tblevents) with a specific
date (or the next date with an event) [easy by itself] and then pull the
proper entertainment (intEntID) from the proper table (tblbands, tbldjs,
or tblother) depending on the type ID. And sort it by location and start
time [***HELP***]
2. pull all records from the special events table (tblspevents) with
that same date (or the next date with an event) [again easy by itself]
3. pull the next 7 records from the holiday "plus" table
(tblholidayplus) that is going on or will go on after the specific date
***(can't get my head around the right algorith)***
4. combine the special events and holiday queries to sort my
date/start date ***[HELP]***
Welcome to my thoroughly confused life. Any ideas are greatly appreciated.
Cutter
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

