[eluser]slowgary[/eluser]
Hey zebake, one more thing...
I mentioned in my comment that I prefer the array way of doing things, e.g.:
Code:
->result_array() //I prefer this way
->result() //over this way
I did a bit of testing and it turns out that the result_array() method uses quite a bit less memory. I'm sure it'd be insignificant if you were just grabbing a few rows, but in your case where you may have several thousand students * X number of guardians per student, you may be looking at a big performance gain in the memory department.
So I recommend using the result_array() method, in which you would access your results like so:
Code:
foreach($students as $student)
{
echo $student['student_id'];
echo "<li>{$student['lname']}, {$student['fname']}</li>"; //surround your array variables with curly braces inside of a string
}