If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Event Post Database Design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-23-09, 22:03
Greelmo Greelmo is offline
Registered User
 
Join Date: Jul 2009
Posts: 4
Event Post Database Design

Hello Everyone,

I posted this accidentally in the "MySQL" forum before I saw this one, so sorry about that.

I am working on a web application that has users log in to their account and create 'events'.

There is a single table for all users, with a primary key of their email address.

I can see 2 ways for each user to be able to create accounts:

1. I could create another table with all posts and an auto_increment key. Then, I could create a relational table that has email address and the key from the events table.

2. I could create a different table for each user that contains all of their events.

Which way is more practical/faster? I'm brand new to this stuff. Thanks everyone!

-Greelmo
Reply With Quote
  #2 (permalink)  
Old 07-23-09, 23:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
first thing you need to do is clarify whether you're talking about accounts, users, events, or posts

those are at least two, possibly three or four tables

but at no time would you assign a new events table to each user
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-24-09, 00:14
Greelmo Greelmo is offline
Registered User
 
Join Date: Jul 2009
Posts: 4
Yes, sorry. I realize I didn't type that very clearly.

I have the accounts table already set up. I'm trying to design the system for each user to be able to post events.

What is the best way to do this?
Reply With Quote
  #4 (permalink)  
Old 07-24-09, 00:17
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
one table for events

include a user FK column to relate each event to its user

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 07-24-09, 00:26
Greelmo Greelmo is offline
Registered User
 
Join Date: Jul 2009
Posts: 4
How can you set up events tables to delete events that have past from this structure?

Do you have to do this manually? I'm using PHP and MySQL
Reply With Quote
  #6 (permalink)  
Old 07-24-09, 04:23
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by Greelmo
Do you have to do this manually?
as opposed to automatically?

use a cron job
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On