Welcome to WebmasterWorld Guest from 54.85.162.213

Forum Moderators: open

Message Too Old, No Replies

Adding a Add to guestlsit feature

Making a correlation between two tables

     
2:14 pm on Nov 1, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 19, 2006
posts:147
votes: 0


I want to allow users to add themselfs to the going list of multiple events.

However I am unsure how to handle this in mysql. I presume I would need to make a field in either table_users or table_events.

e.g. create a field in table_users and store all the id's of the users going to this event. I could then do:

SELECT name from table_users where attendingevent_id='1'

My other problem then is how to store multiple id's in mysql?

I am very confused here so any help to spark my brain would be appreciated.

11:54 pm on Nov 1, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Apr 21, 2004
posts:306
votes: 0


You should normalize things a bit. Instead of adding a field to your event records, you should add a whole other table just to identify who is subscribed to which event. In this Subscriptions table you will need a Subscription_ID (primary key), User_ID, and Event_ID. The Subscription_ID is just an auto-incrementing integer, the User_ID is the primary key from the user table you already have, and the Event_ID is the primary key of the event from the event table.

This gets you around the problem of hacking some way to store multiple user IDs into a single record of one of your existing tables.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members