RE: Pull Down Menu with ODBC query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



BTW I want to make sure I am doing this correctly...

with that current script (edited below with your fix) will I be able to pass that selection on into a further PHP page? I do not see how without assigning a variable to it and passing it with POST... how would I go about this?
 -------------- Original message ----------------------
From: "Simcha" <simcha@xxxxxxxxxxxx>
> 
> odbc_fetch_array() returns an associative array, so will you need to use
> $row[' sls_his_cust_id'] instead of $row[0].
> 
>  
> 
> -----Original Message-----
> From: kitfox69@xxxxxxxxxxx [mailto:kitfox69@xxxxxxxxxxx] 
> Sent: Monday, August 11, 2008 10:14 PM
> To: php-db@xxxxxxxxxxxxx
> Subject:  Pull Down Menu with ODBC query
> 
> 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[sls_his_cust_id]\">$row[sls_his_cust_id]</OPTION>";
> }
> echo  "</SELECT><INPUT TYPE=submit name=submit VALUE=\"Get
> Results\"></FORM>";
> ?>
> 
> Any ideas?
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.138 / Virus Database: 270.6.0/1604 - Release Date: 11/08/2008
> 05:50
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux