i think your column is wrong, static_IP is just true false. If you want to return the contents of the ip address, the column is 'ip'
ie
SELECT mac, ip, hostname, mac_vendor, device_category, device_family, device_name
FROM tips_endpoint_profiles
WHERE mac= <name your variable>
I ran the above (although i used a single MAC to match againest instead of the variable) and it returned fine.
As a FYI,
You can change the appexternal password to somthing you know and then connect to the database using PGadmin. This way you can run a qurey inside of PGadmin to see if you get the results you are looking for.