>-----Original Message----- >From: Mikhail Berman [mailto:mikhail...@gmail.com] >Sent: Wednesday, December 23, 2009 9:16 AM >To: Eva >Cc: mysql@lists.mysql.com >Subject: Re: help design the table > >Hi Eva, > >It seems to me that you might want to have two tables that will describe >data in your database > >* - DOMAINS >* - IPS > >DOMAINS table should contain two fields: > >* `domain_key` - auto-increment >* `domain_name` - varchar(20) > [JS] Quick reminder: domain names can be much longer than 20 characters. Otherwise, your suggestion is wise.
Also, Eva, you should check out the MySQL functions INET_ATON(expr) and INET_NTOA(expr). Before you use them, though, check to make sure they handle IP6 addresses. If they do, then you should store your IP addresses as integers. > >IPS table should contain three fields > >domain_key - int(10) - being a foreign key to DOMAINS table >ip_number - varchar(15) >ip_attribute - varchar(10) > >Hoping this gives you some ideas how to handle this data. > >Regards, > >Mikhail Berman > > >Eva wrote: >> Hello, >> >> I have a table, which has a column named as "domain", each domain has >> some IPs, each IP has two attributes: "disabled","noticed". >> >> For example, the table: >> >> >> domain IP >> www.aol.com 64.12.245.203 64.12.244.203 64.12.190.33 64.12.190.1 >> >> >> But I don't know how to control the IP's attributes if I set this >> table-stru. >> >> Please help,thanks. >> >> Eva. >> >> > >-- >MySQL General Mailing List >For list archives: http://lists.mysql.com/mysql >To unsubscribe: http://lists.mysql.com/mysql?unsub=jschwa...@the- >infoshop.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org