Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and ODBC Menu Issue

Status
Not open for further replies.

kitfox69

Technical User
Aug 6, 2008
36
US
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?
 
Sorry I posted this in the wrong forum... but if you have an answer lease post!
 
Answered in the PHP forum here:
thread434-1493307


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top