This topic is locked

Using Before Record Added Event

10/12/2018 3:40:50 PM
PHPRunner General questions
S
schaet author

Hello,

I'm trying cobble together a simple IP Address Management application. One thing I'm trying to do is when I add an IP address that it is validated that it falls in between the range of two other addresses.
For example:

I have a record display an assigned range: 10.10.10.1 - 10.10.10.100.

I now want to add an IP address to that range. I click 'Add', fill out the required information and hit enter. What I would then like it to do before adding the record is check and see if the new IP address falls in between the 2 IP address parameters that I want to add it to.
I have a query that I use now, but I am unsure how to adapt it for what I need:
SELECT host_ip

FROM hosts

WHERE INET_ATON(ip) BETWEEN INET_ATON(first_ip) AND INET_ATON(last_ip);
Has anyone tried or succeeded in building an IPAM solution using PHPRunner?