Re: More include issues
| From: | Stut | Date: | Wed, 06 Jun 2007 19:23:53 +0000 |
| Subject: | Re: More include issues | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256216@lists.php.net to get a copy of this message | ||
Dan Shirah wrote:
If I put an echo into my included file, the echo displays on the screen. But no results are returned. However, if I copy the data from my include file and paste it directly into my page, I get the results.Ok, so that's confirmed that the include file is being included properly. I think we need to see the code you're using to get the data before we can help any more. -Stut
On 6/6/07, *Stut* <stuttle@gmail.com <mailto:stuttle@gmail.com>> wrote:Okay, I'm stumped!!! I have all of my database connection info in a file:Dan Shirah wrote:I have error_reporting set to E_ALL and display_errors is set to On. And no errors are displayed My code run through as it should...passes my includestatement...displayspart of the form, but when it gets to a dropdown box that ispopulated bythe database (Which the connection is set in the include) itreturns anempty drop down and none of the rest of my form is displayed.Try outputting something in the include file. If that gets displayed then the problem is most likely that the code you have to get the dropdown contents is not returning anything.-StutOn 6/6/07, Jim Lucas <lists@cmsws.com <mailto:lists@cmsws.com>>wrote:Dan Shirah wrote:
connection.phpThis info is stored in a folder: Connections Example of connection.php: <?php $connection = mssql_pconnect('SERVER','user','password') or die
('serverconnection failed'); $database = mssql_select_db("my_database", $connection) or die
('DB
selection failed');
?>
I am trying to include the connection.php file in all of my
pages so Idon't have to hard code the info into every page. But, my data never returns because the include apparently is not
working.If I remove the include and hard code the info, it works. Here is an example of the include statement I am using on my
pages.<?php include '../../Connections/connection.php'; ?> The Connections folder is two level above my form
page. Example filestructure below. ROOT Connections
connection.phpSubmit
Current_Forms
My_Form.php
I've tried ../../../Connections/connection.php,
../../Connections/connection.php,
../Connections/connection.php butnothing works. Any ideas what I am doing wrong???
Set your error_reporting to E_ALL. and set display_errors to On Then you should be able to see all the errors. Because, without the error messages, we are not going to be able
to helpyou. Might I recommend to use include_once instead. This way, it
will onlycreate one connection -- Jim Lucas "Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."Twelfth Night, Act II, Scene V
by William Shakespeare