I am trying to make database array into variables to insert into another function, but I keep getting 'Undefined variable'. I would greatly appreciate it if anybody can guide me in the right direction.
$sql = "SELECT * FROM $tablename WHERE start_day = '".$currentdate."' ";
$result = mysqli_query($conn,$sql);
while($row = mysqli_fetch_array($result))
{
$row ['name'] = $name;
$row ['email'] = $email;
$row ['bID'] = $bID;
$row ['start_time'] = $start_time;
$row ['end_time'] = $end_time;
$row ['start_day'] = $start_day;
MailReminder::sendMail($name , $email, $bID, $start_time,$endtime
,$start_day);
}
mysqli_close($conn);
$row ['name'] = $name;should be$name = $row ['name'];$row['name']etc. directly inside the method call.