Hello i've got a registration script on my site but when the user enters there info and clicks register button it should take them to a page called process.php that congratulates them on registering. When it goes to the page process.php i get this error, Parse error: syntax error, unexpected T_STRING in /***/***/***/***/config.php on line 9 Here is the code for config.php where the error is occuring. I assure you all my database information is correct but if anyone can spot the problem that would be great. <?php class MySQLDB { var $connection; //The MySQL database connection /* Class constructor */ function MySQLDB(){ /* Make connection to database */ $this->connection = @mysql_connect(localhost, ***, ***) or die(mysql_error()); @mysql_select_db(***, $this->connection) or die(mysql_error()); } /** * query - Performs the given query on the database and * returns the result, which may be false, true or a * resource identifier. */ //Use this function as query("Query line of code"); function query($query){ return mysql_query($query, $this->connection); } }; $config = new MySQLDB; ?> Code (markup): Thanks.
You need to replace *** with your database connection details: so instead of $this->connection = @mysql_connect(localhost, ***, ***) or die(mysql_error()); PHP: you shoud have $this->connection = @mysql_connect('localhost', 'my_username', 'my_password') or die(mysql_error()); PHP: