Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2021
    Location
    Norwich
    Posts
    2
    Plugin Contributions
    0

    Default Checkout Problems - Database Insert Errors

    Site is www.atomicworkshop.co.uk, server running PHP 5.4.45, Database: MySQL 10.5.12-MariaDB-cll-lve. No apparent changes caused either problem...

    I have two problems, the first started several months ago and was more of an inconvenience but may be related to the second more serious so I'll detail it too.

    Problem 1
    Several months ago I noticed that some of the entries in the customer table had the appearance of being corrupt - this only applies to the first and last name fields. Screen shot of zen_orders:

    Name:  Screenshot 2021-10-12 184310.png
Views: 97
Size:  10.3 KB

    I'm not too sure if this affected customers logging in but I had no complaints

    Problem 2 (a bit more serious!)
    A couple of weeks ago I had an instance whereby I had received payment vi PayPal but no order saved in the store - TBH, this has happened very rarely in the past and I've put it down to a checkout glitch.

    Then I had another instance and I asked the customer to place the order again but select "Cheque/Money order" as the payment method, the customer reported the error message "WARNING: An Error occurred, please refresh the page and try again" and no order had been saved.

    I then placed a dummy order and received the same error message and at this point extracted the following log file:

    Code:
    [11-Oct-2021 15:21:23 UTC] PHP Fatal error:  1406:Data too long for column 'shipping_method' at row 1 :: INSERT INTO zen_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, ip_address) VALUES ('15', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '01493 369317', '[email protected]', '6', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '6', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '6', 'Cheque/Money Order', 'moneyorder', 'Royal Mail 1<sup>st</sup> Class <span style=\"font-weight: normal; font-style: italic\">&quot;Large Letter&quot;</span> (Great Britain and Northern Ireland only)', 'rm1stlargeletter', '', '', '', '', '', now(), '1', '2.45', '0', 'GBP', '1.00000000', '213.205.240.5 - 213.205.240.5') in /home/tuskerfu/public_html/atomicws/catalog/includes/classes/db/mysql/query_factory.php on line 101
    I then decided to clean out the admin activity log (taking a backup of the database first). This had the unfortunate result of then preventing me from logging in to the admin site - took a snapshot of the log after the login attempt:

    Code:
    [11-Oct-2021 17:14:59 UTC] PHP Fatal error:  1364:Field 'gzpost' doesn't have a default value :: insert into zen_admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'Log found to be empty. Logging started.', '', '213.205.240.5') in /home/tuskerfu/public_html/atomicws/catalog/includes/classes/db/mysql/query_factory.php on line 101
    Luckily with the database backup re-instated I can at least log in as admin.

    Any/all help greatly appreciated.

    Thanks, Jonathan

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default Re: Checkout Problems - Database Insert Errors

    #1 is junk accounts being created by bad guys. You can use Delete Spam Customers to clean these up.

    With issue #2 the problem is likely that you're running such an old version of Zen Cart. You should really upgrade. PHP 5.4/Zen Cart 1.5.0 is long out of service.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: Checkout Problems - Database Insert Errors

    Quote Originally Posted by swguy View Post
    #1 is junk accounts being created by bad guys. You can use Delete Spam Customers to clean these up.

    With issue #2 the problem is likely that you're running such an old version of Zen Cart. You should really upgrade. PHP 5.4/Zen Cart 1.5.0 is long out of service.
    while i agree with the above statement, it does seem that your shipping code is made for a newer version of ZC. if you want to solve this problem, you can backup your database and then run the following sql statement (part of the v156 upgrade process):

    Code:
    ALTER TABLE zen_orders MODIFY shipping_method VARCHAR(255) DEFAULT NULL;
    i take no responsibility for any data loss. backup your data prior to doing any sql statements.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Checkout Problems - Database Insert Errors

    Quote Originally Posted by carlwhat View Post
    while i agree with the above statement, it does seem that your shipping code is made for a newer version of ZC. if you want to solve this problem, you can backup your database and then run the following sql statement (part of the v156 upgrade process):

    Code:
    ALTER TABLE zen_orders MODIFY shipping_method VARCHAR(255) DEFAULT NULL;
    i take no responsibility for any data loss. backup your data prior to doing any sql statements.

    best.
    Also note that by doing so, may disrupt a future proper upgrade as that change was a specific change for the database upgrade to that version. Reason it may "disrupt" the future upgrade (depending on how/to what upgrading) is that the installer/version checker may specifically look for that setting having already been changed to that configuration...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default Re: Checkout Problems - Database Insert Errors

    Software is not like a fine wine that gets better with age. You should really dodge all these issues by doing an upgrade and getting current.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Oct 2021
    Location
    Norwich
    Posts
    2
    Plugin Contributions
    0

    Default Re: Checkout Problems - Database Insert Errors

    Firstly, many thanks for the responses/suggestion to date and the time taken to reply - the Delete Spam Customers looks interesting but now I know it's not more serious. less of a priority right now.

    As for 'Problem 2' yes I do realise I am out of date zencart/PHP wise and an upgrade is on the cards but I would like to figure the problem first to ensure I don't carry something forward to the new install.

    On the face of it, I can see @carlwhat statement, it does loo like something is wrong with the table format but why does the affect the admin activity table 'gzpost'?

    I guess what I'm trying to understand is what has changed - the site was working fine one minute but now it's not.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default Re: Checkout Problems - Database Insert Errors

    Your hoster has updated your MySQL version. Surprise!
    The newer versions of Zen Cart handle this issue properly.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: Checkout Problems - Database Insert Errors

    Quote Originally Posted by AtomicWS View Post
    On the face of it, I can see @carlwhat statement, it does loo like something is wrong with the table format but why does the affect the admin activity table 'gzpost'?

    I guess what I'm trying to understand is what has changed - the site was working fine one minute but now it's not.
    i did not even look at your 2nd log error. my apologies.

    gzpost is not a table. it is a field within a table that does not have a default value.

    your easiest solution is to turn strict mode off.

    if you want to understand why one minute you are not getting errors, the next minute are, i would suggest reading here:

    https://stackoverflow.com/questions/...r-column-mysql

    there is also info there on turning strict mode off.

    your hosting company may also be able to help you.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default Re: Checkout Problems - Database Insert Errors

    ... bearing in mind that turning STRICT mode off is really not a long term solution.

    https://docs.zen-cart.com/user/troub...b_strict_mode/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. database question: insert new users, orders
    By rebusB in forum General Questions
    Replies: 9
    Last Post: 21 Nov 2011, 04:24 AM
  2. Easy Populate why not insert to database
    By jack123 in forum Addon Language Packs
    Replies: 2
    Last Post: 10 Nov 2008, 02:38 PM
  3. Replies: 2
    Last Post: 3 Aug 2008, 03:51 PM
  4. Insert Values from Cloned Module into Database
    By OrganicMan in forum General Questions
    Replies: 2
    Last Post: 26 Jul 2008, 07:17 PM
  5. Insert Gift Certificate manualy to database
    By kalleMD in forum General Questions
    Replies: 10
    Last Post: 12 May 2007, 05:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR