OK thanks, the question is that I have several ips to block then with the require_once php occupy less space.
It wouldn't use any less or any more space. You have to store the IPs in a file to use either method, same as saving them in SQL, therefore they will still take up space.
Another strange thing I see, is that it is blocking me automatically the Tor ips without having the Nastyhost activated panel, does it have something to do with having the code there?
You have the Tor file script discussed on the FaucetBox thread, correct? That will be blocking any Tor nodes on the list. It doesn't matter if you have NastyHosts enabled or not.
How could save the ips in MySQL?
You could just have a table with lots of IPs inside with separate IDs, then call a SQL query to try and find the ID of a certain IP. If the ID comes back as true (there is an id) then block the user. This would probably be a lot more difficult than just putting them in the .htaccess file though, with no benefit.
Sorry friends, the fight is lost or even imagine the amount of visits from VPS, VPN Proxy etc etc etc is amazing!
If you're not using a service like NastyHosts which checks hostnames and such, there will be a lot of VPS and VPN visits. To find those and block those effectively, the best way is to have a service which checks hostnames. NastyHosts is probably the easiest one to use.