query($sql);
while ($row = $sth->fetch(PDO::FETCH_ASSOC)){
(isset($row['ShortDescription'])) ? $shortdescr = $row['ShortDescription'] : $shortdesc = "none";
(isset($row['Description'])) ? $descr = $row['Description'] : $descr = "none";
}
if (isset($shortdescr) && isset($descr)) return array($shortdescr,$descr);
}
function lookup_mac($mac)
{
$db = dbconnect();
$table = WELLKNOWNTABLE;
$sql = "SELECT * from $table WHERE MAC='$mac';";
$sth = $db->query($sql);
while ($row = $sth->fetch(PDO::FETCH_ASSOC))
{
$comment = "".$row['Comment']."";
}
if (!isset($comment))
{
#list($shortdescr,$descr) = lookup_manuf_file($mac);
list($shortdescr,$descr) = lookup_manuf_db($mac);
if (isset($shortdescr))
{
if ($descr == "none")
{
$comment = $shortdescr;
} else
{
$comment = $shortdescr." (".$descr.")";
}
} else $comment = "unknown";
}
return $comment;
}
?>