chernove
08-09-2005, 04:40 PM
I am sure this is something very simple, but I seem to be missing one piece of the puzzle here . . .
On one of my wife's MySQL databases (I'm the webmaster on her FQ-hosted site), I have two different tables: events and venues.
In the events table I have a field called "venueid."
In the venues table I have the following fields:
id
venue
contact
address1
address2
phone
When people go to her site, they can see her upcoming concerts in a table listing the date, day, time and cost of the event (this info. is taken from "events"). What I'd like to do is have the info. for the venue looked up and displayed, too, based on the venueid (which is matched by the id in "venues"). The reason I have these separated into two tables is that she plays at some venues quite often and I'd like to just be able to put in "yeah, this one's at venue #5" rather than reenter all the info. for venue #5.
For example, let's say she has an upcoming concert at Weill Recital Hall in NYC. There would be an entry in the venues table with the contact info for that hall. For the sake of argument, let's give that hall id #3 (in the venues table).
An example of the entry for the event in the events table would be as follows (I'll fill in most of the fields, just so you get the idea; most are immaterial for my current question):
id = 20
status = current [this is as opposed to "archive"]
day = Thursday
month = 11
date = 04
year = 2004
time = 5:30
tod = PM
venueid = 3
guest1 = John Doe, violin
guest2 = Jim Doe, clarinet
summary = The Doe Brothers are special guests in this evening's concert.
cost = 20
program = Chopin: Ballade in G minor, op. 23<br>Bartok: Contrasts<br>Beethoven: Sonata #32 in C minor, op. 111
All of the above information would be available to be displayed, but I want venueid (3) to be replaced, of course, with the actual information for that venue (id #3 in the venues table).
Any help would, as always, be greatly appreciated.
Thanks,
Eric
On one of my wife's MySQL databases (I'm the webmaster on her FQ-hosted site), I have two different tables: events and venues.
In the events table I have a field called "venueid."
In the venues table I have the following fields:
id
venue
contact
address1
address2
phone
When people go to her site, they can see her upcoming concerts in a table listing the date, day, time and cost of the event (this info. is taken from "events"). What I'd like to do is have the info. for the venue looked up and displayed, too, based on the venueid (which is matched by the id in "venues"). The reason I have these separated into two tables is that she plays at some venues quite often and I'd like to just be able to put in "yeah, this one's at venue #5" rather than reenter all the info. for venue #5.
For example, let's say she has an upcoming concert at Weill Recital Hall in NYC. There would be an entry in the venues table with the contact info for that hall. For the sake of argument, let's give that hall id #3 (in the venues table).
An example of the entry for the event in the events table would be as follows (I'll fill in most of the fields, just so you get the idea; most are immaterial for my current question):
id = 20
status = current [this is as opposed to "archive"]
day = Thursday
month = 11
date = 04
year = 2004
time = 5:30
tod = PM
venueid = 3
guest1 = John Doe, violin
guest2 = Jim Doe, clarinet
summary = The Doe Brothers are special guests in this evening's concert.
cost = 20
program = Chopin: Ballade in G minor, op. 23<br>Bartok: Contrasts<br>Beethoven: Sonata #32 in C minor, op. 111
All of the above information would be available to be displayed, but I want venueid (3) to be replaced, of course, with the actual information for that venue (id #3 in the venues table).
Any help would, as always, be greatly appreciated.
Thanks,
Eric