Re: Question about databases and foreign keys
| From: | Micah Gersten | Date: | Mon, 15 Sep 2008 14:59:49 +0000 |
| Subject: | Re: Question about databases and foreign keys | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45404@lists.php.net to get a copy of this message | ||
Use 2 tables. You never know what the app might grow into and you
should do it right the first time.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Jason Pruim wrote:
> Hi everyone,
>
> I just wanted to make sure that I am not making something more
> complicated then it has to be.
>
> I am working on a time clock application to use at my company, and so
> far, I have a login table, and with a foreign key that links to the
> time table. The thinking being, that when someone logs in, they get
> assigned there employee number, and then it adds a new record for that
> employee ID.
>
> All I will be doing with the info, is grabbing the total amount of
> time they were clocked in for each day, and then totaling for the week.
>
> I'm planning on using timestamps to store the actual time, hopefully
> making the math part easier :)
>
> Do I need the foreign key and the 2 tables? Or should I just add the
> column's into the database since it will be for a small company?
>
> Ideas? Suggestions?
>
> Thanks!
>
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 11287 James St
> Holland, MI 49424
> www.raoset.com
> japruim@raoset.com
>
>
>
>
>