Here is the codes and error below:
Error:
Quote
Here are the short codes:
class cdb {
// Construction
function cdb() {
// When initiated, it immidietly runs the connect function
$this->connect();
}
// Connects to database server and to the database
function connect() {
// Connect to database server
mysql_connect(SQL_HOST,SQL_USER,SQL_PASS) or die("Couldn't connect to database!");
// Connect to database
mysql_select_db(SQL_DB) or die("Coudln't find table!");
}
// Closes connection
function close() {
// disconnects
mysql_close();
}
// Makes a query and returns the result
function query($str) {
// query the mysql statement
$result = mysql_query($str);
// returns the result
return $result;
}
// Function to gather all the configrations located in the database.
function get_config() {
// sql statement
$sql = "SELECT * FROM ".SUFFIX."config";
// gather result
$result = $this->query($sql);
// if there are results go on
if(mysql_num_rows($result)) {
while($row = mysql_fetch_assoc($result)) {
// if a constant is not defined
if(!defined($row['name'])) {
// define a new constant with the database name + value
define($row['name'], $row['value']);
}
}
}
}
}
