Having trouble with this dropdown issue. I'm filling a dropdown from a PostgreSQL table with no problems. The only difference is using the odbc_* functions against a Pervasive.SQL database. I've pasted the entire script if anyone out there has time to see what I'm not doing correctly.
<?
include_once("logonemp.inc"

;
session_start();
$connection = pg_connect ("host=$host dbname=$db user=$user
password=$pass"

;
if (!$connection)
{
die("Could not open connection to PostgreSQL"

;
}
$connect_soinc = odbc_connect("soinc","",""

;
if (!$connect_soinc)
{
die("Error in SOINC connection"

;
}
$connect_topllc = odbc_connect("TOPLLC","",""

;
if (!$connect_topllc)
{
die("Error in TOPLLC connection"

;
}
$user_id = $_SESSION['SESSION_UID'];
$ss_num = $_SESSION['SUP_SSN'];
//TOPLLC queries...
$t_query1 = "SELECT UPEMPL.FIRSTNAME, UPEMPL.LASTNAME
FROM
topllc.UPEMPL
WHERE
UPEMPL.SSN = '$ss_num'";
$t_query2 = "SELECT COUNT(*)
FROM
topllc.UPEMPL
WHERE UPEMPL.SSN = '$ss_num'";
$t_result1 = odbc_exec($connect_topllc, $t_query1);
$t_result2 = odbc_exec($connect_topllc, $t_query2);
$t_sup_first = trim(odbc_result($t_result1, 1));
$t_sup_last = trim(odbc_result($t_result1, 2));
$t_supervisor = $t_sup_first . " " . $t_sup_last;
$t_query3 = "SELECT UPEMPL.FIRSTNAME, UPEMPL.LASTNAME, UPEMPL.SSN
FROM
topllc.UPEMPL
WHERE
UPEMPL.SUPERVSR = '$t_supervisor'";
$t_result3 = odbc_exec($connect_topllc, $t_query3);
$t_count=(int)odbc_result($t_result2,1);
//SOINC queries...
$s_query1 = "SELECT UPEMPL.FIRSTNAME, UPEMPL.LASTNAME
FROM
soinc.UPEMPL
WHERE
UPEMPL.SSN = '$ss_num'";
$s_query2 = "SELECT COUNT(*)
FROM
soinc.UPEMPL
WHERE UPEMPL.SSN = '$ss_num'";
$s_result1 = odbc_exec($connect_soinc, $s_query1);
$s_result2 = odbc_exec($connect_soinc, $s_query2);
$s_count=(int)odbc_result($s_result2,1);
$s_sup_first = trim(odbc_result($s_result1, 1));
$s_sup_last = trim(odbc_result($s_result1, 2));
$s_supervisor = $s_sup_first . " " . $s_sup_last;
$s_emp_query = "SELECT UPEMPL.LASTNAME, UPEMPL.FIRSTNAME
FROM
soinc.UPEMPL
WHERE
UPEMPL.SUPERVSR = '$s_supervisor'";
$s_result3 = odbc_exec($connect_soinc, $s_emp_query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
<html>
<head>
<title>Employee List</title>
</head>
<body bgcolor="#FFFFFF" background="background2.gif">
<form name="SubMain" action="benefit_summary.org.php" method="post"><div align="center">
<img src="tnologo.gif" /> <div align="center">
<hr width="50%" />
<div align="center"> <font color="#000000"><font size=3><strong>AVAILABLE
EMPLOYEES:</strong></font><br />
<br />
<?
if ($t_count > 0)
{
echo "<select name=employees>\n";
while ($row = odbc_fetch_row($t_result3)) {
echo '<option value="'.$row[0].'">'.$row[0].'</option>'."\n";
}
echo "</select>\n";
}
else
if (s_count > 0)
{
echo "<select name=employees>\n";
while ($row = odbc_fetch_row($s_result3)) {
echo '<option value="'.$row[0].'">'.$row[0].'</option>'."\n";
}
echo "<select>\n";
}
echo "<br />";
pg_close ($connection);
odbc_close ($connect_soinc);
odbc_close ($connect_topllc);
?>
</div>
<hr width="50%" />
<p>
<div align="center">
<input type="submit" name="submit" value="SUBMIT">
</p></form>
</body>
</html>