I have a file called db_config.php, which reads like this :
<?php
$db_host = "localhost";
$db_user = "root";
$db_password = "f00";
$db_name = "buzzdb";
?>
and another one called temp_con.php, which reads like this :
<?php
require("db_config.php")
$connection = mysql_connect($db_host, $db_user, $db_password, $db_name) or die("error connecting");
echo "connection made";
?>
The thing I want to do is make temp_con.php read the db_config.php, setting the variables and then using those variables to login to my database.
However I get this error,
Parse error: syntax error, unexpected T_VARIABLE in C:\XAMPP\htdocs\temp_con.php on line 3
What's wrong? Thanks for helping 🙂