note 62308 deleted from function.require-once by sobak
| From: | sobak@php.net | Date: | Thu, 01 Dec 2016 17:40:14 +0000 |
| Subject: | note 62308 deleted from function.require-once by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207903@lists.php.net to get a copy of this message | ||
Note Submitter: martijn(dot)lowrider(at)gmail(dot)com
----
How to use Require_Once with error reporting to include a MySQL Connection file:
-------------------------------------------------------------------
$MySQLConnectFile = './inc/MySQL.Class.php';
if ( is_dir ( './inc/' ) )
{
$IncIsDir == TRUE;
}
if ( file_exists ( $MySQLConnectFile ) )
{
$MySQLFileExists == TRUE;
}
if ( $IncIsDir && $MySQLFileExists )
{
require_once ( $MySQLConnectFile )
}
else
{
echo '<b>Error:</b> <i>Could not read the MySQL Connection File. Please try
again later.';
exit();
}
----------------------------------------------------------------------