Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database postcode field size - paypal table: Data too long for column 'address_zip' #6609

Closed
torvista opened this issue Jul 22, 2024 · 2 comments · Fixed by #6618
Closed
Assignees

Comments

@torvista
Copy link
Member

PHP Fatal error: MySQL error 1406: Data too long for column 'address_zip' at row 1 ::
INSERT INTO paypal
(order_id, txn_type, module_name, module_mode, reason_code, payment_type, payment_status, pending_reason, invoice, first_name, last_name, payer_business_name, address_name, address_street, address_city, address_state, address_zip, address_country, address_status, payer_email, payer_id, payer_status, payment_date, business, receiver_email, receiver_id, txn_id, parent_txn_id, num_cart_items, mc_gross, mc_fee, mc_currency, settle_amount, settle_currency, exchange_rate, notify_version, verify_sign, date_added, memo)
VALUES ....

Yes this was a long postcode: 4445-649 ERMESINDE from Portugal.

From Wikipedia for Portugal
".... is formed by four digits, a hyphen, then three digits, followed by a postal location of up to 25 characters in capitals."
Sounds like the "postcode" could be longer than the address!!

Default address_book and paypal postcode fields are 10 characters.

I find that my address_book has long been 34 characters, but I'd never changed the paypal one.

Obviously not a common problem...
https://www.zen-cart.com/showthread.php?186400-How-to-change-the-maximum-length-for-postcode

@lat9
Copy link
Contributor

lat9 commented Jul 25, 2024

The field length for the three xxx_postcode fields in the orders table will also need "expansion".

@lat9
Copy link
Contributor

lat9 commented Jul 25, 2024

Might as well round the lengths up to the next power of two, i.e. varchar(64).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants