3

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 :)

EDIT 2:

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);
    }
    else
    {
    $gradevalue = $row["AssignTask_GradeValue"];
    $taskid = $row["AssignTask_TaskID"];

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

    } </code>
2
  • managed to work out a solution by doing a for loop for each of my users and results by putting them into a multi dim array. Commented Sep 18, 2015 at 0:42
  • If you've found a solution to your problem, you should form it into a good answer and then self-answer your question. This will allow your information to be more useful to other people. Commented Aug 12, 2016 at 9:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.