MySQL keyToString and stringToKey