Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/2020 in all areas

  1. Looking at you latest output examples I would suggest you lose the "subject_position" table. All you need to store are the highlighted result values below. All the rest (totals, positions) can be derived by querying the data TABLE: result +-------------+--------------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------------------+------+-----+---------+----------------+ | result_id | int(11) | NO | PRI | NULL | auto_increment | | regno | int(11) | YES | MUL | NULL | | | year | varchar(45) | YES | | NULL | | | semester | varchar(45) | YES | | NULL | | | subjectid | int(11) | YES | MUL | NULL | | | result_type | enum('CA1','CA2','Exam') | YES | | NULL | | | pcent | int(11) | YES | | NULL | | +-------------+--------------------------+------+-----+---------+----------------+ Note: I have omitted armsid and armsLevel as I haven't clue what they are and where they belong in the schema.
    1 point
  2. It just occured to me that our grade tables are not the same. The missing subjects are 4, 9 and 12 so I extracted those records... mysql> SELECT * FROM subject_position -> WHERE subjectid in (4,9,12) -> and semesterid='1' -> and yearid='1' -> and armsLevelId='1' -> and armsId='1' -> ORDER BY regno, subjectid; +----+-------+-----------+-------------+--------+------------+--------+-------+ | id | regNo | subjectid | armsLevelId | armsId | semesterid | yearid | total | +----+-------+-----------+-------------+--------+------------+--------+-------+ | 23 | 4663 | 12 | 1 | 1 | 1 | 1 | 69 | | 7 | 4663 | 4 | 1 | 1 | 1 | 1 | 99 | | 17 | 4663 | 9 | 1 | 1 | 1 | 1 | 96 | | 24 | 6073 | 12 | 1 | 1 | 1 | 1 | 94 | | 8 | 6073 | 4 | 1 | 1 | 1 | 1 | 95 | | 18 | 6073 | 9 | 1 | 1 | 1 | 1 | 96 | +----+-------+-----------+-------------+--------+------------+--------+-------+ Could it be that those total values are missing from the grade ranges in your grade table and so no matches are found? Try LEFT JOIN grade and see if all records now appear. [edit] Your results - Getting 100% and still failing must have been a little disheartening!
    1 point
  3. No such issues my end. My results for 4663 were posted earlier and for 6073 I get +--------+------------+-------+-----------+------+-------+-------+-------------+ | yearid | semesterid | regno | subjectid | rank | total | grade | comment | +--------+------------+-------+-----------+------+-------+-------+-------------+ | 1 | 1 | 6073 | 1 | 1 | 73 | B2 | V Good | | 1 | 1 | 6073 | 2 | 1 | 61 | C4 | Good | | 1 | 1 | 6073 | 3 | 2 | 61 | C4 | Good | | 1 | 1 | 6073 | 4 | 2 | 95 | A* | Distinction | | 1 | 1 | 6073 | 5 | 1 | 100 | A* | Distinction | | 1 | 1 | 6073 | 6 | 2 | 67 | C2 | Good | | 1 | 1 | 6073 | 7 | 1 | 80 | A | Excellent | | 1 | 1 | 6073 | 8 | 2 | 77 | B1 | V Good | | 1 | 1 | 6073 | 9 | 1 | 96 | A* | Distinction | | 1 | 1 | 6073 | 10 | 2 | 77 | B1 | V Good | | 1 | 1 | 6073 | 11 | 1 | 88 | A | Excellent | | 1 | 1 | 6073 | 12 | 1 | 94 | A* | Distinction | +--------+------------+-------+-----------+------+-------+-------+-------------+ As you can see, 12 subjects for both using your data posted at the start. Pulling both together, ordered by subject/rank gives +--------+------------+-------+-----------+------+-------+-------+-------------+ | yearid | semesterid | regno | subjectid | rank | total | grade | comment | +--------+------------+-------+-----------+------+-------+-------+-------------+ | 1 | 1 | 6073 | 1 | 1 | 73 | B2 | V Good | | 1 | 1 | 4663 | 1 | 2 | 72 | B2 | V Good | | 1 | 1 | 6073 | 2 | 1 | 61 | C4 | Good | | 1 | 1 | 4663 | 2 | 2 | 47 | D7 | Pass | | 1 | 1 | 4663 | 3 | 1 | 82 | A | Excellent | | 1 | 1 | 6073 | 3 | 2 | 61 | C4 | Good | | 1 | 1 | 4663 | 4 | 1 | 99 | A* | Distinction | | 1 | 1 | 6073 | 4 | 2 | 95 | A* | Distinction | | 1 | 1 | 6073 | 5 | 1 | 100 | A* | Distinction | | 1 | 1 | 4663 | 5 | 2 | 70 | B2 | V Good | | 1 | 1 | 4663 | 6 | 1 | 69 | C1 | Good | | 1 | 1 | 6073 | 6 | 2 | 67 | C2 | Good | | 1 | 1 | 6073 | 7 | 1 | 80 | A | Excellent | | 1 | 1 | 4663 | 7 | 2 | 77 | B1 | V Good | | 1 | 1 | 6073 | 8 | 2 | 77 | B1 | V Good | | 1 | 1 | 4663 | 8 | 2 | 58 | D2 | Pass | | 1 | 1 | 4663 | 9 | 1 | 96 | A* | Distinction | | 1 | 1 | 6073 | 9 | 1 | 96 | A* | Distinction | | 1 | 1 | 4663 | 10 | 1 | 78 | B1 | V Good | | 1 | 1 | 6073 | 10 | 2 | 77 | B1 | V Good | | 1 | 1 | 6073 | 11 | 1 | 88 | A | Excellent | | 1 | 1 | 4663 | 11 | 2 | 48 | D7 | Pass | | 1 | 1 | 6073 | 12 | 1 | 94 | A* | Distinction | | 1 | 1 | 4663 | 12 | 2 | 69 | C1 | Good | +--------+------------+-------+-----------+------+-------+-------+-------------+ Looks like you broke it or changed your data. Not much I can do about either.
    1 point
  4. The bigger question at this point is what is the actual problem you're trying to solve? Given what you've just posted, you'd be far better off simply injecting $descriptionVar into the markup on the server.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.