Please refer my previous post here. I did changes accordingly but getting error. Please help me figure out the errors in this code. My IDE (Aptana) is giving red underlines on many lines of this code:
<?php
/* Include dependency */
require_once("./Config/dbconfig.php");
abstract class dbconnection
{
var $conn;
try
{
//Opens connection for a MySQL DB
public function OpenConnection()
{
$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)
or die (throw new DB_Exception_Handler('Cannot connect to DB: ' . $thisException->getMessage() . '.'));
mysql_select_db(DB_NAME) or
die (throw new DB_Exception_Handler('Cannot connect to DB: ' . $thisException->getMessage() . '.'));
}
//Closes connection for a MySQL DB
public function CloseConnection()
{
mysql_close($conn);
}
}
catch(DB_Exception_Handler($thisException)
{
$thisException->ShowError();
}
}
class DB_Exception_Handler extends Exception
{
public function ShowError()
{
echo "<script>alert('". $this->getMessage() ."');</script>";
}
}
?>