0

hi, guys i have a problem here.
i have a form which creates a new table for each new user and that user will have a monthly update of his salary now im confused how to go about this. do i need to create a new table or how to go about.............................

2
Contributors
8
Replies
10
Views
6 Years
Discussion Span
Last Post by smantscheff
0

name:
email:
phone:
address:

this is the form for the new user and the below is for salary update for every month of each user

amount: date: check number:

this is the format i want brother please help me im struck up

0

Create one table for users, one table for salaries, and join them on the user ID.

create table users
( id integer not null primary key auto_increment
, name text
, email text
, phone text
, address text
);
create table salaries 
( id integer not null primary key auto_increment
, id_user integer not null
, year integer not null
, month integer not null
, salary float not null
, foreign key (id_user) references users (id)
);

Edited by smantscheff: n/a

0

thanks bro but i dint get the second part of it could u please detail it for me

0
CREATE TABLE salaries
( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT
, id_user INTEGER NOT NULL
, YEAR INTEGER NOT NULL
, MONTH INTEGER NOT NULL
, salary FLOAT NOT NULL
, FOREIGN key (id_user) REFERENCES users (id)
);

this part is a bit confusing whats the manual where is it i don no anything about it i am a newbie

Edited by lkrvk: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.