I have the following code:
<?php
session_start();
echo $_SESSION['Username'];
$mysqli = new mysqli('****','****','****','****');
if($mysqli->errno)
{
mail("**@yahoo.com", "***/Account.php Connection Error", $mysqli->error . "\nUser: " . $_SESSION['Username']);
}
else
{
$stmt = $mysqli->prepare("SELECT FirstName, LastName, Expires, Expires WHERE EMail=?");
$stmt->bind_param('s', $_SESSION['Username']);
$stmt->execute();
$stmt->bind_result($FirstName, $LastName, $Expires);
$stmt->store_result();
while($row = $stmt->fetch())
{
....
I am getting VERY strange behavior. I am receiving the error Fatal error: Call to a member function bind_param() on a non-object in /home/content/42/7401242/html/****/Account.php on line 12
I use this EXACT code on many other pages and it works perfectly. Any thoughts why I might be getting this error randomly?