Re: More include issues
| From: | Dan Shirah | Date: | Wed, 06 Jun 2007 19:45:24 +0000 |
| Subject: | Re: More include issues | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256227@lists.php.net to get a copy of this message | ||
../../Conn/prpr_mssql.php
or
../../Connections/connection.php
These are the same file, I was just changing the name to
Connections/connection.php for a little added security of my info being on
the web is all.
On 6/6/07, Jim Lucas <lists@cmsws.com> wrote:
Stut wrote: Dan Shirah wrote:$rec;Ask and you shall recieve!! :) // My include statement at the beginning of the body <?php include '../../Conn/prpr_mssql.php'; ?> **Various plain HTML form data here** // My dropdown box that is not getting populated <?php // Query the credit_card_type table and load all of the records // into an array. $sql = "SELECT * FROM credit_card_code_types ORDER BY credit_card_type_desc"; $res = mssql_query($sql) or die(mssql_error()); while ($rec = mssql_fetch_assoc($res)) $credit_card_type_desc[] =value=\"{$c['credit_card_type_code']}\">{$c['credit_card_type_desc']}</OPTION>\n";// die('<pre>'.print_r($credit_card_type_code)); 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 "<OPTIONOk, I can't see anything wrong with that. Are you absolutely sure it works when you replace the include line with the contents of the include file? Are you sure you're replacing it exactly? One minor thing... that include file is not the same path and filename you gave in your original post. You are looking at the right piece of code yes? but he said that he echo'ed something from the include file. Which file was it called from? One thing I'd suggest you add is a check after the mssql_query to see how many rows were returned. Beyond that I'm stumped. -Stut I'm thinking this is a scope issue are either of these two pieces of code being called from within a function or class? the display code, or the include statement? was it ../../Conn/prpr_mssql.php or ../../Connections/connection.php Which file did you have the include statement in? -- Jim Lucas "Some men are born to greatness, some achieve greatness,} ?>and some have greatness thrust upon them."Twelfth Night, Act II, Scene Vby William Shakespeare