14 Mar
2016
14 Mar
'16
9:38 p.m.
* Mark Weiman <mark.weiman@markzz.com> (Mon, 14 Mar 2016 13:09:09 -0400):
On Mon, 2016-03-14 at 10:12 +0100, Marcel Korpel wrote:
VARCHAR(40) is too short, I think, see http://stackoverflow.com/q/166132/258127
According to Linux header files, the maximum length of an IPv6 address is 45 characters.
I'm not 100% sure how this actually stores the address, but if it's stored in its hex form, it can only be as large as 39 characters (4*8+7) making 40 characters more than enough.
Plain text: $q.= "LastLoginIPAddress = " . $dbh->quote($_SERVER['REMOTE_ADDR']) . " "; Anyway, consumer-wise it doesn't matter whether it's a VARCHAR(39) or VARCHAR(48), see https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html#idm1396904... Marcel