Here's the answer: I found it in another forum for a similar problem.
before the foreach statement add if ($students) like it is shown below
if ($students)
foreach ($students as $student)
Here's the answer: I found it in another forum for a similar problem.
before the foreach statement add if ($students) like it is shown below
if ($students)
foreach ($students as $student)