Re: More include issues

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

 



I only added those echo's since we have been trying to figure this out, so I
could see how far it was getting before it stopped.   When I select "VIew
Source", the last line of code is:

<SELECT name="credit_card">


On 6/6/07, Stut <stuttle@xxxxxxxxx> wrote:

Dan Shirah wrote:
> <SELECT name="credit_card">
> <?php
> *  *** This is the query that uses the inlude file database connection
> info that is currently returning no results *
>   // Query the credit_card_type table and load all of the records
>   // into an array.
>   echo "Pre-SQL";  **** This does not echo out*
>   $sql = "SELECT * FROM credit_card_code_types ORDER BY
> credit_card_type_desc";
>   $res = mssql_query($sql) or die(mssql_error());
>   echo $sql; **** This does not echo out*
>   echo $res; **** This does not echo out*
>   while ($rec = mssql_fetch_assoc($res)) $credit_card_type_desc[] =
$rec;
>
>   // die('<pre>'.print_r($credit_card_type_code));
> * *** No data is returned in the dropdown list*
>   foreach ($credit_card_type_desc as $c)
>   {
>     if ($c['credit_card_type_code'] == $_POST['credit_card'])
>       echo "<OPTION value=\"{$c['credit_card_type_code']}\"
> SELECTED>{$c['credit_card_type_desc']}</OPTION>\n";
>     else
>       echo "<OPTION
>
value=\"{$c['credit_card_type_code']}\">{$c['credit_card_type_desc']}</OPTION>\n";
>
>   }
> ?>
> </SELECT>

Get rid of the echo statements in there - they will really screw up the
output of the select box. Alternatively view the source of the page this
displays - chances are that the options are being output properly, but
the HTML is so messed up that you end up with an empty select box.

-Stut


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux