I am trying to write a php to fetch from a mysql dba and use the result set in a dropdown list as a input for another php to query on the variable. Ideally I only want to show the lastname, firstname, and Call Sign while using the MembersId as the argument for the form php.
I get a drop down list to show but it has no data. When I look at the source I see that the query ran and can see the result set.
I appreciate any advice I can get.
<html>
<?php
include('connectDb.php');
$sql="Select MembersId, lastName, firstName, callSign from
SVARC.members";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$users = $stmt->fetchAll();
?>
<form action="LastMeetingAttendancebyDate.php" method="post">
<select name ="user">
<?php
foreach($users as $user){
echo("<option value='");
echo($user['MembersId']+"'>");
echo($user['lastName']);
echo",";
echo($user['firstName']);
echo" ";
echo($user['callSign']);
echo("'</option>");
}
?>
</select>
<input type="submit">
</form>