How about this? (Not tested.)
$sth = $dbh->prepare("SELECT COUNT(*) FROM users WHERE host=? AND date +>DATE_SUB(NOW(), INTERVAL 5 MINUTE)"); $sth->execute($host); $row = $sth->fetchrow_arrayref or die "some kinda error"; if ($row->[0]) { # there's already a user in the database which was # registered from this IP, less than five minutes ago. # fail in some way. }
In reply to Re: Dont allow multiple registrations or automated script problem
by smammy
in thread Dont allow multiple registrations or automated script problem
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |