Q:

Fatal error: Call to undefined function INET_ATON()

I'm successfully storing an IP address in my database using the the INET_NTOA function as follows:
$sql="INSERT INTO $tbl_subnets(address) VALUES(INET_NTOA('$address')

However when trying to reverse this when selecting the address using INET_ATON I get the the following error: 
Fatal error: Call to undefined function INET_ATON()
Using this code...
<?php
    $sql="SELECT * FROM subnets";
        $result=mysql_query($sql);

        // Start looping the rows in the database.
        while($rows=mysql_fetch_array($result)){
?>

<td><?php echo $rows[INET_ATON('address')]; ?></td>

<?php

}

?>

Anyone can shed some light on this for me? Thanks

A:

inet_aton() is a Mysql function. In PHP, you'd use inet_ntop() and inet_pton().

