I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this information needs to me centrally managed allowing all staff to get the data they need.

Here is a picture of the data we are trying to store:

enter image description here

We currently have the following tables in our sql database:

  • tbl_students (holding student information)
  • tbl_Objectives (a list of task which are then assigned to a student for assessment - Each goal has to be individually assigned as some of the tasks do not apply to each student)
  • tbl_assigned_objectives (assi_id, assi_Obj_ID, assi_Stu_ID, assi_Grade)

So I can get the information in a nice individual report but presenting it just like the above picture is proving more difficult then thought.

I'm needing to get the students from the table tbl_students on the vertical columns and do a for loop for each objective while looking up their result in tbl_assigned_objective.

Am I on the right path? Or is my sql table structure wrong?

edit: i have managed to put together my strcture but now getting php to echo the right areas. i can echo out my names but not my goals, or vice versa goals but not my names.

enter image description here

link to my code as i dont know how to do it here :S

Thanks to MichaelT for editing before :)


managed to manipulate my data by doing a for loop and pushing the data in my for loop to a multidim array

while($row = $result->fetch_assoc()) { // echo "123";
if ($lastusername!= $row["AssignTask_UserID"]) { $lastusername= $row["AssignTask_UserID"]; $gradevalue = $row["AssignTask_GradeValue"]; $taskid = $row["AssignTask_TaskID"];

    $myarray[$lastusername] = array($taskid => $gradevalue);
    $gradevalue = $row["AssignTask_GradeValue"];
    $taskid = $row["AssignTask_TaskID"];

    $myarray[$lastusername] += array($taskid => $gradevalue);

    } </code>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.