Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Multiple Entries in a Column?
Old 04-01-2005, 05:57 PM Multiple Entries in a Column?
Novice Talker

Posts: 8
Trades: 0
If I had a database of musicians and a column for various info, would it be possible to have more than 1 entry for searching purposes? For example, if I had Shania Twain, and a column for music genre, she could be considered country or pop. If my search did select * from Musicians where genre = pop, I would want her to come up, but I would also want here to come up if the genre was country. How would I go about doing that, or would I have to do some scripting to filter the results?
sjaguar13 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-01-2005, 06:41 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Well, the trick is using more than one table. Have a table with different genres as it's columns and two ID's, one unique id for that specific entry and one ID that matches the artist ID you want to associate with that genre. Now when you insert records into both tables you can simply use a 1 or a zero for each genre in the table, if its a one then their music belongs in that genre if its 0 it's does not.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-01-2005, 06:57 PM
Novice Talker

Posts: 8
Trades: 0
Ohhh...so in tableMusicians I could have:
pKey = 1
Artist = Shania Twain
Whatever = Crap

Then have tableGenre:
pKey = (some unique number)
ArtistID = 1 (Shania's pKey)
Pop = 1
Country = 1
Death Metal = 0

So I would then search tableGenre for Country = 1, if I wanted that genre?
sjaguar13 is offline
Reply With Quote
View Public Profile
 
Old 04-01-2005, 07:56 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Exactly, I hoped I was being clear enough. Glad you got it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple Entries in a Column?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15935 seconds with 12 queries