Pull Down Menu with ODBC query

From: Date: Mon, 11 Aug 2008 20:14:12 +0000
Subject: Pull Down Menu with ODBC query
Groups: php.db 
Request: Send a blank email to php-db+get-45199@lists.php.net to get a copy of this message
I am having trouble getting this script to populate the query data into a pull down menu. The SQL script works fine and displays the data with odbc_result_all but will not put it in the menu. Script is as follows: <?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 "</SELECT><INPUT TYPE=submit name=submit VALUE=\"Get Results\"></FORM>"; ?> Any ideas?

« previous php.db (#45199) next »