I want to create a student term result sheet, below is the format, giving to me by the school please help. how do I get the design. The results are being fetched from a database and displayed on the table.
In the database, I have a table called result_secondary and another table called category table. Each subject has a category the falls under and in the result_secondary table there is a column called:
subjectCat
$mysqli = new mysqli('localhost','root','','fountain');
if (mysqli_connect_errno()) {
exit('Oops! connection was not successful...contact web admin');
}
$cat="select category from subjectcat";
$cat_filter=$mysqli->query($cat);
$count_r=$cat_filter->fetch_array();
$count[]=$count_r["category"];
$query = "SELECT * FROM result_secondary WHERE studentAdno = '$adno'
AND stclass = '$class' AND term = '$term' AND sessions = '$session'
ORDER BY subjectCat";
So I used the query below to fetch all the results from the result_secondary
table and display them on the table using a table.
Student Result Screen Shot Image
Please compare this two image you will notice that on the second image which is my design, the subject category in the category column keeps repeating itself. I only want the category name to appear once in the category name and the query that falls under that category to be listed at the right hand side.
I want it to be the same with the format given by the school, by the right hand side, the subject under a category are listed
Please help me with the correct query to use so I can get it right. I have used group by and ordered by but still not giving me what I want
this one below is what I have done so far
SCREEN SHOT DESIGNED BY ME
please the different in this two result sheet is clear. On the first template, the subject category name (which is the first column)appeared once. But on the template designed by me, the subject category name appeared more than once. Which is not supposed to be.
My challenge is on the category name column. Each category have different subjects that falls under them. So i want to get the exact design of the first template. I also drew a mark on area of challenge in the main template for comparison. please kindly look at the both result sheet you will notice my challenge.
The result sheet with a man picture is the one i designed and that is my picture, you will see on the category column (first column) that the subject category keep appearing more than once which is not the same with the scanned copy given by the school
thanks