I'm using xampp on windows XP, and am writing a page for a form that includes a database connection script:
- Code: Select all
require_once ('../mysql_connect.php') or die ('Could not connect to the database: ' . mysql_error() );
When I ran the page the form displayed, but I got this error at the place in the form where the include was called:
Warning: main(../mysql_connect.php): failed to open stream: No such file or directory in C:\TrygLand\Utilities\xampp\htdocs\websites\bandsite\submit_photos.phpon line 47
Fatal error: main(): Failed opening required '../mysql_connect.php' (include_path='.;C:\TrygLand\Utilities\xampp\php\pear\') in C:\TrygLand\Utilities\xampp\htdocs\websites\bandsite\submit_photos.phpon line 47
Just a few minutes ago I was messing around with file locations and syntax to try to get the page to work properly, and when I deleted the 'or die' part of the require_once, the page worked fine. I have no clue why that worked, and would like to be able to use error reporting in future sites, so any help anyone could provide would be great.