|
-
Nov 8th, 2006, 05:13 PM
#1
Thread Starter
Frenzied Member
php include question
weird i dont know what im doing wrong
i made a file called mysql_conn.php and put it in the db_conn folder
i have my main index.php in the php folder
php(folder)
images(folder)
db_conn(folder)
but when i try to include the DB_conn file it says
Warning: main(./db_conn/mysql_conn.php) [function.main]: failed to open stream: No such file or directory in C:\Inetpub\jf1\a\php\index.php on line 9
Warning: main() [function.include]: Failed opening './db_conn/mysql_conn.php' for inclusion (include_path='.;c:\php4\pear') in C:\Inetpub\jf1\a\php\index.php on line 9
Here is my include statment:
<?php
//connection to database
include('./db_conn/mysql_conn.php');
?>
-
Nov 8th, 2006, 06:12 PM
#2
Re: php include question
Well, is db_conn a subdirectory of the current working directory, as index.php sees it?
The answer is no, db_conn is a sibling. You want '../db_conn/mysql_conn.php' as the file path.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|