#!/usr/local/bin/php
<?php
$ip = $argv[1];
include('mysql.php');
$query = "SELECT `nasip` FROM `nas` WHERE `netid` IN (SELECT `netid` FROM `nethosts` WHERE `ip` = '" . $ip . "')";
$result = DB_query($query);
while ($line = DB_fetch_array($result, MYSQL_ASSOC)) {
    foreach ($line as $col_value) {
        print ($col_value);
    }
}
?>
