致命错误:调用未定义的函数INET_ATON() [英] Fatal error: Call to undefined function INET_ATON()
本文介绍了致命错误:调用未定义的函数INET_ATON()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已使用INET_NTOA函数成功地在数据库中存储了IP地址,如下所示:
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')
但是,当尝试使用INET_ATON选择地址时将其反转时,出现以下错误:
However when trying to reverse this when selecting the address using INET_ATON I get the the following error:
致命错误:调用未定义的函数INET_ATON()
Fatal error: Call to undefined function INET_ATON()
使用此代码...
<?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
推荐答案
inet_aton()
是Mysql函数.在PHP中,您可以使用 inet_ntop()
和 inet_pton()
.
inet_aton()
is a Mysql function. In PHP, you'd use inet_ntop()
and inet_pton()
.
这篇关于致命错误:调用未定义的函数INET_ATON()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文