It looks to me more like this:
Quote:
|
Originally Posted by Limit
If the IP is in the banlist with the same reason for banning increase attempts by 1.
|
There is no reference to "the reason" in the select above, so simply if this IP appears in the table it will increase the attempts by one.
Quote:
|
Originally Posted by Limit
If the IP is not in the database or the same IP has been banned again but for a different reason insert IP again, new reason, ban date and attempts to 1
|
It will only do an insert if the IP is not already in that table, for the same reason above.
You need to include the "reason" in the select statement, something like:
Code:
$q = "SELECT *
FROM ". $table_prefix ."table1
WHERE ban_reason = '".$reason."'
AND ban_ip = '". encode_ip($ip) ."'";