Wildcard IP Banning with MySQL

前端 未结 5 1881
甜味超标
甜味超标 2021-02-01 11:01

I\'m trying to implement an IP banning system into my web app using MySQL, i know i can do it using .htaccess but that\'s not neat to me.

Basically my curre

5条回答
  •  遇见更好的自我
    2021-02-01 11:32

    Quick'n'Dirty, but cannot use proper indexes:

    SELECT ip FROM ip_blacklist WHERE ? LIKE REPLACE(ip,'*','%') LIMIT 1
    

提交回复
热议问题