What I want to do is execute a query. Then populate a dropdown box with the results. What I need to be in the dropdown is, both FirstName and LastName. When the following code runs, I get the dropdown, and it has the correct number of "spaces" but I am not seeing any names. For example, my query returns 7 people, the dropdown has 7 empty spots. What am I missing in the code...
--QUERY--
$s_emp_query = "SELECT UPEMPL.LASTNAME, UPEMPL.FIRSTNAME, UPEMPL.SSN
FROM
soinc.UPEMPL
WHERE
UPEMPL.SUPERVSR = '$s_supervisor'";
$s_result3 = odbc_exec($connect_soinc, $s_emp_query);
$s_emp_count = 0;
while (odbc_fetch_row($s_result3))
{
$s_emp_count++;
}
--DROPDOWN--
if ($s_emp_count > 0)
{
echo "<select>\n";
for ($i=0;$i<$s_emp_count;$i++)
{
$s_employees = pg_fetch_array($s_result3);
echo "<option value=$s_employees[0]>$s_employees[0]</option>\n";
}
echo "</select>\n";
}
--QUERY--
$s_emp_query = "SELECT UPEMPL.LASTNAME, UPEMPL.FIRSTNAME, UPEMPL.SSN
FROM
soinc.UPEMPL
WHERE
UPEMPL.SUPERVSR = '$s_supervisor'";
$s_result3 = odbc_exec($connect_soinc, $s_emp_query);
$s_emp_count = 0;
while (odbc_fetch_row($s_result3))
{
$s_emp_count++;
}
--DROPDOWN--
if ($s_emp_count > 0)
{
echo "<select>\n";
for ($i=0;$i<$s_emp_count;$i++)
{
$s_employees = pg_fetch_array($s_result3);
echo "<option value=$s_employees[0]>$s_employees[0]</option>\n";
}
echo "</select>\n";
}