I can log into the system, but when I'm testing the "Add Staff" page, I receive this error:
"Parse error: syntax error, unexpected T_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\linkexchangesystem\admin\dbconnector.php on line 21"
Here's the code for the php file in question:
Code: Select all
?php
/* Class: DbConnector Purpose: Connect to the MySQL Database */
require_once('../admin/systemcomponent.php');
$theQuery = 0;
$link = 0;
class DbConnector {
/* Function: DbConnector, Purpose: Connect to the Database */
function DbConnector(){
/* Load settings from parent class */
$settings = systemcomponent::getSettings();
/* Get the main settings from the array */
$host = $settings['dbhost'];
$db = $settings['dbname'];
$user = $settings['dbusername'];
$pass = $settings['dbpassword'];
/* Connect to the Database */
$this->link mysql_connect('$host','$user','$pass');
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));
}
/* Function: query, Purpose: Execute Database Query */
function query($query) {
$this->theQuery = $query;
return mysql_query($query, $this->link);
}
/* Function: fetchArray, Purpose: Get array of query results */
function fetchArray($result) {
return mysql_fetch_array($result);
}
/* Function: close, Purpose: Close the connection */
function close() {
mysql_close($this->link);
}
}
}
?>