我有以下代碼:PHP腳本mysqli的神祕不工作
<?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())
{
....
我得到很奇怪的行爲。我收到錯誤Fatal error: Call to a member function bind_param() on a non-object in /home/content/42/7401242/html/****/Account.php on line 12
我用這個確切的代碼在許多其他的網頁和它完美的作品。任何想法爲什麼我可能會隨機得到這個錯誤?