我有以下代码:
<?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
我在许多其他页面上使用了这个 EXACT 代码,它运行良好。任何想法为什么我可能会随机收到此错误?