PHP MySQL Log of Additional Submissions -
i have online test taking system once user submits test form adds row table so;
employee id | employee name | date test 1 taken
employees can retake tests want replace 'date test 1 taken' date of recent submission, however, want log previous submissions.
so i'd want second table 3 previous submissions so; employee id | previous submission 1 | previous submission 2 | previous submission 3
is possible "this employee retook test on different date, take current date in 'date test 1 taken', move other table under 'previous submission 1' , place current date in 'date test 1 taken'? extremely complicated, if @ possible..?
i suggest design improvement. seems goal keep running record of each employee , test type. table should like:
employeetest table: employeeid, employeename, testnum, datetaken, score
you insert row employeetest table every test taken. can write queries like:
select employeeid, employeename, testnum, datetaken, score employeetest order datetaken
to see test employee in date order. or:
select employeename, testnum, max(datetaken), score employeetest employeeid = 'joe' , testnum = 1
to latest date , score employee 'joe' test #1
of course employeename should broken out employee table (employeeid, employeename), didn't want muddy issue joins @ point.
have fun...
Comments
Post a Comment