<?php 
include('dbconnect.php');
$sql="SELECT * FROM account";
$res = $conn->query($sql);
while($row = $res->fetch_assoc()){
    $empID = $row['userid'];
    $yearupdate = date('Y-m-d');

    echo $ptosql = "INSERT INTO `pto`(`name`,`maxpto`, `multiplier`, `updatestat`, `ptoearned`, `usedpto`, `availablepto`, `empid`, `yearupdate`) VALUES
            ('Maternity Allocation','','','','','','','$empID','$yearupdate')";

    $conn->query($ptosql);
    echo $conn->error;

    echo $empID.'- SUCCESS <br>';
            

}

?>