Ok I am working on some PHP pages that use ODBC commands to connect and display data from my Pervasive Database.
So far connecting and getting the data is working fine but now I am trying to populate a pull down menu with some query data and I can't seem to do so.
Here is my script thus far:
<?php
$conn = odbc_connect("HOMES", "", "");
$billdate = $_POST[ 'billdate' ];
$query = ("SELECT DISTINCT(sls_his_cust_id)
FROM sls_his
where sls_his_prchdat_alt = $billdate");
$result = odbc_exec($conn, $query);
echo "<FORM method=POST action=getcustdata.php>";
echo "<SELECT NAME=column_name>";
while($row = @odbc_fetch_array($result))
{
echo "<OPTION VALUE=\"$row[0]\">$row[0]</OPTION>";
}
echo "<INPUT TYPE=submit name=submit VALUE=\"Get Results\"></SELECT></FORM>";
odbc_close($conn);
?>
I get the menu but no data populates it?!?
Does anyone see what I have done wrong?
So far connecting and getting the data is working fine but now I am trying to populate a pull down menu with some query data and I can't seem to do so.
Here is my script thus far:
<?php
$conn = odbc_connect("HOMES", "", "");
$billdate = $_POST[ 'billdate' ];
$query = ("SELECT DISTINCT(sls_his_cust_id)
FROM sls_his
where sls_his_prchdat_alt = $billdate");
$result = odbc_exec($conn, $query);
echo "<FORM method=POST action=getcustdata.php>";
echo "<SELECT NAME=column_name>";
while($row = @odbc_fetch_array($result))
{
echo "<OPTION VALUE=\"$row[0]\">$row[0]</OPTION>";
}
echo "<INPUT TYPE=submit name=submit VALUE=\"Get Results\"></SELECT></FORM>";
odbc_close($conn);
?>
I get the menu but no data populates it?!?
Does anyone see what I have done wrong?