I am creating a back end form that admins will fill in for a race results page .
The results web page provides the following information:
Race name
race category
distance
competitor name if a solo race
team name if a team race
team members
car used to race in
date of race
date of category/event in the race
time completed in
team members are usually different for each race but they come from a larger membership
I set up the following tables in a database
CREATE TABLE IF NOT EXISTS results (
id int(11) NOT NULL auto_increment,
date date NOT NULL,
event varchar(75) NOT NULL,
categoryOrRaceInEvent varchar(75) NOT NULL,
city varchar(75) NOT NULL,
country varchar(75) NOT NULL,
teamEnteredIntoRaceOrCategory varchar(75) NOT NULL,
car varchar(75) NOT NULL,
distance varchar(75) NOT NULL,
result varchar(75) NOT NULL,
crewID varchar(75) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
CREATE TABLE IF NOT EXISTS users (
userID int(10) unsigned NOT NULL auto_increment,
forename char(50) NOT NULL,
surname char(50) NOT NULL,
email char(50) NOT NULL,
role char(25) NOT NULL,
membershipStatus varchar(75) NOT NULL,
committeeRole varchar(75) NOT NULL,
PRIMARY KEY (userID)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
CREATE TABLE IF NOT EXISTS crews (
crewID char(13) NOT NULL,
raceID int(11) NOT NULL,
typeOfCar varchar(75) NOT NULL,
surname varchar(75) NOT NULL,
forename varchar(75) NOT NULL,
userID int(11) NOT NULL,
PRIMARY KEY (crewID)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
I started creating the form and was intending to use one form to insert the data entered on the form into these three tables. The user names would be generated from the user table so the admin could just select them, same thing with the race name and other details that might recur.
Is this the best way to do this? Are my tables set up even remotely correctly?
Any ideas/ tips would be gratefully received.
Thanks ever so much.