[PHP Being Gay] PHP Not Loading File

Started by G_G, June 18, 2011, 04:06:26 am

Previous topic - Next topic

G_G

June 18, 2011, 04:06:26 am Last Edit: June 18, 2011, 04:36:20 am by game_guy
For whatever reason my file isn't being "included". I have a config file.
<?php
// MySql Host
$db_host  = "localhost";
// MySql Username
$db_user  = 'root';
// MySql Password
$db_pass  = '';
// MySql Database
$database = 'testdb';
?>


Then in my index page.
<?php
include("config.php");
$db_connection = mysql_connect($db_host, $db_user, $db_pass);
$db_database = mysql_select_db($database);
?>


I'm getting errors like so.
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config\Container.php on line 111

Notice: Undefined variable: db_host in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: db_user in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: db_pass in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: database in C:\xampp\htdocs\rmx-os\main.php on line 4


Which is odd because I've done this exact thing before. I'm using xampp 1.7.4. Any idea whats wrong? O_o

EDIT: What the hell Blizzard? >:U Why is there PHP syntax but no ruby? HMM?!?!? :V

EDIT 2: OMG BECAUSE FILE NAMING YOUR PHP SCRIPTS MAKES ALL THE EFFING DIFFERENCE. Apparently theres a config.php file in "C:\xampp\php\PEAR\" which the errors clearly state. So when you go to use...
include("config.php");

Its going to error, so you must rename the file. :facepalm:

Blizzard

You might also wanna add "global variable_name_1, variable_name_2, etc" if some variables aren't accessible.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.