Forum Moderators: open

Message Too Old, No Replies

MYSQL NOOB Request. is my tables done correctly? and a quick doubt.

         

Ac3fl

1:14 pm on Oct 6, 2008 (gmt 0)

10+ Year Member



Hello and thx for reading my post so soon... Well i got a relational database and before all I AM A NOOB into this... I am currently studieng computer sience but i havent taken mysql and php clases, but because of a new job i gotta do this system... well my tables are for helping their workers fill up a monthly report of their absences... Soo lets start with the db... First table is for the user name and password, second i got a table for the personal info but on where i got really doubts on is over the report...

Report_id_table
id, emp_id, month, yr
1, 873, 09 08
Report_Table
id, emp_id, date, month, year, reason, period of absence, am/pm
1 873 12 09 08 VAC 12 3

Ok let me explain well i really got the first table because i want to validate the month with each report made because you can only make 1 per month. On the other table i got the id and emp id so i can know who they are, then the date month year ( im pretty sure theres a way to make it day/month/year but i dont know if i can validate like that and use it separately) then the reason like here is vacation, then the period of days, and if its going to be half day or the hole day (3=whole)... please help any suggestions... THX!

lethal0r

11:38 am on Oct 10, 2008 (gmt 0)

10+ Year Member



im sure you can do this with only one table - you dont need the first one.

I THINK its possible to use the DATE type (YYYY-MM-DD) and have the first 7 characters (YYYY-MM) as a unique index. This would allow only 1 entry per month.

make sense?

Ac3fl

12:06 pm on Oct 10, 2008 (gmt 0)

10+ Year Member



Ok guys ive gotten my crap up lol...
First ive fixed the tables so they are still a relational db(i cant do it in a single table cuz theres plenty of people and because this is still a growing proyect so i am able to easily add and remove tables... if you want how it would look just ask... Second yes thats what i need to work on now the damn string management so i can make it a key.. but at least 2 weeks into it (b4 i just did crappy things didnt know wut i wus doing) i have a complete login and working on bugs and the next week ill work into the report itself but really thanks for all anything you need just reply this messege and ill awnser :) thx guys! and lethal0r too later...