public static function getDbCon() { if (self::$m_dbCon == null) { self::$m_dbCon = mysql_connect(RingsideApiConfig::$db_server, RingsideApiConfig::$db_username, RingsideApiConfig::$db_password); if (!self::$m_dbCon) { throw new Exception('The service is not available at this time : db connect failure ' . mysql_error(), mysql_errno()); } if (!mysql_select_db(RingsideApiConfig::$db_name, self::$m_dbCon)) { echo "error selecting" . mysql_error(); throw new Exception('The service is not available at this time : db catalog failure ' . mysql_error(), mysql_errno()); } } return self::$m_dbCon; }