I’ve been working a little bit on a Facebook application, but when I registered a new user to test the friend interaction the new user got a uid (100000XXXXXXXXX) that seems to big for php to handle.
Saving the number in the database results in the same value (2147483647). I’m guessing this is also PHPs fault, as I would believe the uid would fit in an unsigned bigint?
I’m not quite sure where to go from here, any suggestions?
The fix is to store the UID as a string always. Use the
VARCHARfield type in MySQL and you will be fine.In general, many database gurus will tell you that interpreting another application’s foreign keys (like UID in this case) is bad bad bad and you should handle them as opaque text.