为什么它会回归真实?

Joh*_*nny 0 php

我似乎无法找到问题.

// Check that someone from this IP didn't register a user within the last hour (DoS prevention)
$query = mysqli_query($dbc, "SELECT COUNT(id) FROM accounts WHERE registration_ip = '".$_SERVER['REMOTE_ADDR']."'  AND registered > ".(time() - 3600));

if (mysqli_num_rows($query) > 0) {
    $errors[] = 'To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.';
}
Run Code Online (Sandbox Code Playgroud)

无论如何,为什么总是这样?即使帐户表是空的.

ema*_*tel 6

如果我没弄错的话,你的数据总是1行表示计数的值(因为你正在使用计数).