I can't get this query to work. It only shows the first DB entry. Any ideas greatly appreciated.
/* prepare */
$sql = "SELECT personal.firstName, personal.lastName, etc. 
        FROM personal 
        LEFT JOIN exam 
        ON personal.P_ID=exam.P_ID 
        LEFT JOIN contact 
        ON exam.P_ID=contact.P_ID 
        WHERE exam.Level = ? 
        AND exam.Centre!='' ORDER BY exam.Centre";
$stmt = $db->prepare($sql);
/* Execute */ $stmt->execute(array($level));
/* Fetch */
            $row = $stmt->fetch(PDO::FETCH_ASSOC);    
/*  Display  */
                    echo '<table>
                         <tr>
                    <td>Name</td>
                    <td>Surname</td>
                    <td>Paid?</td>
                    <td>Etc</td>
                    <td>Etc</td>
                    <td>Etc</td>
                        </tr>';
if ($row) { foreach ($row as $key => $value)
              {
                echo '<td>';
                echo $value;
                echo '</td>';
            }
               echo '</tr>';
          }
       echo '</table>';
 
     
     
    