If you're going to use a database of some sort, then you have to start there. No script or other solution can be made without first having the database format that is being used. That said, it would make more sense to just check it from one of the many sites that give you that information from an IP.
Keep in mind that IP addresses will only tell you where the ISP is, not the person.