Wednesday, 21 August 2013

Create a database for webapplication. keep primary key for tables mysql

Create a database for webapplication. keep primary key for tables mysql

I am developing a webapplication but I am pretty new to this. Basic idea:
user logs in and can input data through many different forms. Each form
should be connected to a user and catalogued by year and month.
Right now my db structure is:
core_user: id_user,username, password core_year: id_year, year core_month:
id_month, month ch: id_ch, many variables...
I would like to have columns in core_year, core_month and ch that register
id_user so that I can retrieve and store data for the user and by month
and year.
I've tryed with foreign keys but had no success. What I'd like to have:
task--> user registered--> unique primary key=id_user task--> year
registered--> unique primary key=id_year with with the id_user of the
session that is going on.
and so on..
Any suggestion?
Thank you so much for the help!

No comments:

Post a Comment