My page 'list.php' gets in infinite loop when showing values.
I used a while
to show all database values
The PHP code used on the listing.php
<?php while($row = $resultado):?>
<tr>
<td><?php echo $row->ID; ?></td>
<td><?php echo $row->courseName; ?> </td>
<td><?php echo $row->name; ?> </td>
<td><?php echo $row->date; ?> </td>
<td><?php echo $row->comment; ?></td>
</tr>
<?php endwhile;?>
The function with Query is written like this:
function selectAll(){
$this->connect();
$resultSet = $this->pdo->query("SELECT comment.ID, courseName, name, date, comment FROM comment, course, teacher WHERE teacher.idCourse = course.ID AND comment.idTeacher = teacher.ID;");
return $resultSet->fetch(PDO::FETCH_OBJ);
}