I designed a PHP Class
with a Static
Properties and I get a blank page without any error log
, Kindly assist me whats wrong in my PHP Code?
<?php
ini_set("display_startup_errors", 1);
ini_set("display_errors", 1);
error_reporting(-1);
class Response
{
public $Status;
public $Message;
function __construct() {
$this->Status = FALSE;
$this->Message = "";
}
}
$response = new Response();
class Connection
{
static private $server = "localhost"
static private $database = "Student";
static private $user = "ram";
static private $password = "ram12345!";
static public $link;
public static function Trigger() {
try
{
if (!isset(self::$link)) {
self::$link = mysql_connect("localhost", "bbminfoc_bbm", "Princess4BBM.>") or die("Couldn't make connection.");
if(!self::$link)
{
$response->Status = FALSE;
$response->Message = "Database Connection Failed !";
}
else
{
if(!mysql_select_db(self::$database, self::$link))
{
$response->Status = FALSE;
$response->Message = "Couldn't select database Main !";
}
}
}
}
catch(Exception $e) {
$response->Status = FALSE;
$response->Message = "Exception: " . $e->getMessage();
}
if(!$response->Status)
{
unset(self::$link);
}
}
}
if(!isset(Connection::link))
{
Connection::Trigger();
}
$outp = json_encode($response);
if(isset($outp))
{
echo($outp);
}
else
{
echo("No Data");
}
?>
Kindly assist me in this code, I don't know what I did wrong in the above pasted code because I can't able to see the log information in error_log file.