(Added [ PHP ] tags around code -- NogDog)
Hi, Ive only just started in the world of web design and am having a few problems with a login script.
I am using a php script to connect to my MySQL Database.
I get the following error;
Parse error: syntax error, unexpected T_VARIABLE in /homepages/8/d236017605/htdocs/loginphpmake/db_connect.php on line 19
My Script is:
<?php
//require the PEAR::DB classes.
require_once 'DB.php';
$db_engine = 'mysql';
$db_user = 'username';
$db_pass = 'password';
$db_host = 'localhost';
$db_name = 'database';
$datasource = $db_engine.'://'.
$db_user.':'.
$db_pass.'@'.
$db_host.'/'.
$db_name;
$db_object = DB::connect($datasource, TRUE);
/* assign database object in $db_object,
if the connection fails $db_object will contain
the error message. */
// If $db_object contains an error:
// error and exit.
if(DB::isError($db_object)) {
die($db_object->getMessage());
}
$db_object->setFetchMode(DB_FETCHMODE_ASSOC);
// we write this later on, ignore for now.
include('check_login.php');
?>
I have entered the database name and password, host etc.
Please help!!!