Page goes blank when working with database <p>I am working on a form for a friend. When a user submits the form their IP address is added into a database table. Every time a user then visits the form I run a check to see if their IP address is already in the table. If it is then they have already submitted the form. </p> <p>I did this previously but decided to change how it works and now when I got to run any queries or connect to the database the whole page goes blank.</p> <p>Here is my database class (class.Database.inc.php):</p> <pre><code>&lt;?php /** * MySQLi database; only one connection is allowed. */ class Database { private $_connection; // Store the single instance. private static $_instance; /** * Get an instance of the Database. * @return Database */ public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; } /** * Constructor. */ public function __construct() { $this-&gt;_connection = new mysqli('localhost', 'MHP_TICKET_ADMIN', 'fZx_142n', 'MHP_TICKET_SYS'); // Error handling. if (mysqli_connect_error()) { trigger_error('Failed to connect to MySQL: ' . mysqli_connect_error(), E_USER_ERROR); } } ?&gt; </code></pre> <p>The code at the top of the form file (index.php):</p> <pre><code>&lt;?php require_once('class.Database.inc.php'); // Check database to see if the user has already submitted. $user_ip = $_SERVER['REMOTE_ADDR']; $db = Database::getInstance(); $mysqli = $db-&gt;getConnection(); $sql_query = "SELECT ip FROM ip_address WHERE ip = '$user_ip'"; $result = $mysqli-&gt;query($sql_query); if ($row = $result-&gt;fetch_assoc()) { die('You have already placed your submission.'); } ?&gt; </code></pre> <p><strong>EDIT</strong> I entered the credentials in the wrong order, and it took me 2 hours to figure that out...</p>