I have tried every single expalnation on this but I keep getting errors please help me out guys this might have been answered but its over a week I keep struggleing with it.
I have two Tables
Student and Certificate the two tables have a relationship on student, i have a unique column student reg no and on certificate student reg which are bot the same values.
I am trying to select data from the two table into a table in html but its not working
here is my statement
<?php 
    $sql = "SELECT * s.studentsregno
                     s.fullname
                     s.program
                     c.certificateno AS cert_no
                     c.dateofissue AS date_ofissue
                     c.status AS pick_status
           FROM student s
           JOIN certificate c on c.studentreg = s.studentregno";
   $result = $db->query($sql);
   if ($result->num_rows > 0) {
       // output data of each row
       while($row = $result->fetch_assoc()){
           echo
               '<tr class="odd gradeX">
                    <td>'.$row["studentregno"].'</td>
                    <td>'.$row["fullname"].'</td>
                    <td>'.$row["program"].'</td>
                    <td class="center">'.$row["cert_no"].'</td>
                    <td class="center">'.$row["date_ofissue"].'</td>
                    <td class="center">Picked</td>
                </tr>';
        }
    } 
    $db->close();
?>
 
     
    