Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Ok, I have set up a MySQL database and I am trying to link to it but I'm having some trouble. I have set up an external file in a config (so it is held in D:\site path\config) folder with the following information:Code: Select all
<?php
$db_host = "localhost";
$db_user = "php";
$db_password = "123";
$db_name = "test";
?>Code: Select all
<?php
require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
echo "connection made";
?>Code: Select all
Warning: require(D:/Program Files/xampp/htdocs/config/db_config.php) [function.require]: failed to open stream: No such file or directory in D:\Program Files\xampp\htdocs\site\temp_con.php on line 2
Fatal error: require() [function.require]: Failed opening required 'D:/Program Files/xampp/htdocs/config/db_config.php' (include_path='.;d:\Program Files\xampp\php\pear\') in D:\Program Files\xampp\htdocs\site\temp_con.php on line 2Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]