Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将whois结果存储到MySQL_Php_Mysql - Fatal编程技术网

Php 如何将whois结果存储到MySQL

Php 如何将whois结果存储到MySQL,php,mysql,Php,Mysql,我有一个PHP脚本用于搜索任何域的whois信息。我想将这些信息存储到MySQL表中,以便以后使用。我该怎么做 下面是我需要存储在MySQL表中的结果,引擎是MyISAM 我尝试过文本法,但没有成功 Registrant: Dns Admin Google Inc. Please contact contact-admin@google.com 1600 Amphitheatre Parkway Mountain View CA

我有一个PHP脚本用于搜索任何域的whois信息。我想将这些信息存储到MySQL表中,以便以后使用。我该怎么做

下面是我需要存储在MySQL表中的结果,引擎是MyISAM 我尝试过文本法,但没有成功

Registrant:
        Dns Admin
        Google Inc.
        Please contact contact-admin@google.com 1600 Amphitheatre Parkway
         Mountain View CA 94043
        US
        dns-admin@google.com +1.6502530000 Fax: +1.6506188571

    Domain Name: google.com

        Registrar Name: Markmonitor.com
        Registrar Whois: whois.markmonitor.com
        Registrar Homepage: http://www.markmonitor.com

    Administrative Contact:
        DNS Admin
        Google Inc.
        1600 Amphitheatre Parkway
         Mountain View CA 94043
        US
        dns-admin@google.com +1.6506234000 Fax: +1.6506188571
    Technical Contact, Zone Contact:
        DNS Admin
        Google Inc.
        2400 E. Bayshore Pkwy
         Mountain View CA 94043
        US
        dns-admin@google.com +1.6503300100 Fax: +1.6506181499

    Created on..............: 1997-09-15.
    Expires on..............: 2020-09-13.
    Record last updated on..: 2012-01-29.

    Domain servers in listed order:

    ns4.google.com
    ns1.google.com
    ns2.google.com
    ns3.google.com




MarkMonitor is the Global Leader in Online Brand Protection.

Domain Management
MarkMonitor Brand Protection™
MarkMonitor AntiPiracy™
MarkMonitor AntiFraud™
Professional and Managed Services

Visit MarkMonitor at www.markmonitor.com
Contact us at 1 (800) 745-9229
In Europe, at +44 (0) 203 206 2220

根据我的理解,如果您想使用保存信息,则将db结构设置为:

whois_table
{
id (num)(pk)
ip (varchar)
info(long text)
}
假设您有以下信息:

$ip=要插入的ip个人信息 $info=谁是ip的信息

INSERT INTO whois_table (ip, info ) values ($ip, $info);

你能告诉我们你到目前为止写的代码吗?你已经创建了一个MySQL表,你只是需要查询方面的帮助,还是你也需要创建表结构?你想存储谁的信息?我最好使用
INT
字段类型来存储ip。@hookman:我假设存储的ip是字符(即facebook.com)。虽然对于存储ip,如192.168.12.123,由于点的原因,需要varchar。您必须这样做。