| ollie | luke-jr do you use longip()? |
| luke-jr | no, wtf is longip()? |
| action | chadmaynard recommends INET_NTOA() and INET_ATON() for IP's in mysql |
| chadmaynard | recommends INET_NTOA() and INET_ATON() for IP's in mysql |
| ollie | it turns an ip into a number like -1062731506 that is 192.168.1.14 |
| luke-jr | my problem is that varchar(15) is too small for IPs varchar(40) is needed |
| ollie | using my method I can use int(10) |
| chadmaynard | varchar is bogus |
| ollie | I think it is a good way to do it, someone recommended it in a chat room. what do you think? |
| luke-jr | Ollie: int(10) would be too small for an IP too -.- |
| chadmaynard | Ollie: INET_NTOA,ATON are the MySQL functions for converting IPs to/from LONG |
| ollie | luke-jr not when it is converted using the longip() php function |
| MysticOne | so any other ideas on why mysql won't let me login? |
| luke-jr | Ollie: there are more IP addresses than LONG values |
| TheMafia | is there a way I can use sum in the where part of of a query, ie select item_name, sum(quantity),reorder_level from items where in_use = 0 and category_id='wireless' and reorder_level < sum(quantity) group by item_name; |
| chadmaynard | like-jr: ehh? unsigned |
| luke-jr | yeah, unsigned 128 bits in an IP longs are only 64-bit at most |
| ollie | sorry its called ip2long() http://uk3.php.net/manual/en/function.ip2long.php ip2long Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address |
| chadmaynard | luke-jr: ips are 32 bit |
| luke-jr | chadmaynard: no 2002:1891:f663:0:2b0:d0ff:fe49:6b31 please explain how that is 32 bit |
| MysticOne | anyone? *hopeful look* |
| chadmaynard | not ipv6 |
| ollie | yeah you can fit ipv4 into a long |
| luke-jr | v6 is the most recent IP ver |
| ollie | :) |
| chadmaynard | luke: and barely used.... mysql 6 is out but we dont assume you are on it |
| luke-jr | chadmaynard: never had problems with MySQL 4/5... |
| ollie | As of December 2005, IPv6 accounts for a tiny percentage of the live addresses in the publicly-accessible Internet, which is still dominated by IPv4. The adoption of IPv6 has been slowed by the introduction of classless inter-domain routing (CIDR) and network address translation (NAT), each of which has partially alleviated the impact of address space exhaustion. from wikipedia :) |
| luke-jr | that statement includes Windoze lusers I think you'd find *nix users are a bit more likely to be v6 capable |
| IoC_ | hi.. im getting the "com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column " error.. i googled and saw the fix was "jdbcCompliantTruncation=false" which don't think is nice.. is there a way to set the max size of a blob? like 10 Megabytes? it worked for smaller files like 10-30KB files though... |