尝试以下操作(使用从prepare返回的语句对象):
<?php $previous_entries = new mysqli($db_host, $db_username, $db_password, $database); $check = $previous_entries->prepare("SELECt ID,NICK FROM users WHERe EMAIL=?;"); $check->bind_param("s",$email); $check->execute(); $check->bind_result($maybe_id,$maybe_got_something); if($check->num_rows > 0){ while ($check->fetch()) { if ($maybe_got_something==$nickname){ echo "Hooray!"; } } }?>


