how to restive data using two while loop : the first query works fine and it retrieves the class id but I have a problem with the second query do not retrieve the child name 

    <select name="child-name" id="Schild">
                <?php
                $username = $_SESSION['username'];
                $sql1 = "SELECT Class_id FROM Class WHERE Emp_id = '$username'";
                $result = mysqli_query($database,$sql) or die(mysqli_error($database));
                
                while($row = mysqli_fetch_array($result))
                {
                    $classID = $row['Class_id'];
                    $sql2 = "SELECT Name FROM Children WHERE Class_id = '$classID'";
                    $result2 = mysqli_query($database,$sql2) or die(mysqli_error($database));
                    while($row = mysqli_fetch_array($result2))?>
                <option><?php echo $row['Name'];?></option>  
                
                <?php }?> 
            </select>