提前致谢。
require_once 'login.php';
$db_server = mysqli_connect($db_hostname,$db_username,$db_password,$db_database);
$query = "SELECT * FROM users WHERE username = 'ben944' AND firstlogin = '0'";
$result = mysqli_query($db_server,$query);
if(!$result) {
echo "not working";
exit;
}
$row = mysqli_fetch_row($result);
while($row = mysqli_fetch_assoc($result))
{
print_r($row);
}
答案 0 :(得分:3)
单独的$row = mysqli_fetch_row($result);
行已经在while循环开始之前从结果中取出并删除第一行。这就是为什么它不是由while循环打印的(显然是为了调试目的而添加的)。