Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default Additional Product Images WITH MYSQL 5.7.23 does not work

    Additional Product Images - Version: 2.1

    I'm working locally with mamp pro, mysql version 5.7.23 and php 7.1.22

    When I load an additional image it gives me error 503 and this error log;

    [16-Jan-2019 10:46:56 Europe/Rome] Request URI: /ADMIN/additional_product_images_upload.php?products_id=108&action=insert, IP address: ::1
    #1 trigger_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:171]
    #2 queryFactory->show_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:143]
    #3 queryFactory->set_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:270]
    #4 queryFactory->Execute() called at [/Applications/MAMP/htdocs/MYDOMAINE/Hoist-gzM-Adult/additional_product_images_upload.php:45]

    with mysql version 5.6 everything works fine

    [16-Jan-2019 10:46:56 Europe/Rome] PHP Fatal error: 1364:Field 'category_id' doesn't have a default value :: insert into additional_images
    (products_id, additional_image, status)
    values ('108',
    'additional/myimage.jpg',
    '1') ==> (as called by) /Applications/MAMP/htdocs/MYDOMAINE/ADMIN/additional_product_images_upload.php on line 45 <== in /Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php on line 171


    PHP Code:
    $db->Execute("insert into " TABLE_ADDITIONAL_IMAGES "
                        (products_id, additional_image, status)
                        values ('" 
    zen_db_input((int)$_GET['products_id']) . "',
                                '" 
    $additional_image_name "',
                                '1')"
    ); 
    Thanks for your help
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  2. #2
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Additional Product Images WITH MYSQL 5.7.23 does not work

    You can solve that by going to your phpmyadmin (or equivalent) and add a default value of 0 to categories_id in the table structure of additional_images.
    This a new feature on mysql5.7, where a integer field needs a value in the query, or else it will fail, unless you have set a default value.
    Quote Originally Posted by diamond1 View Post
    Additional Product Images - Version: 2.1

    I'm working locally with mamp pro, mysql version 5.7.23 and php 7.1.22

    When I load an additional image it gives me error 503 and this error log;

    [16-Jan-2019 10:46:56 Europe/Rome] Request URI: /ADMIN/additional_product_images_upload.php?products_id=108&action=insert, IP address: ::1
    #1 trigger_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:171]
    #2 queryFactory->show_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:143]
    #3 queryFactory->set_error() called at [/Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php:270]
    #4 queryFactory->Execute() called at [/Applications/MAMP/htdocs/MYDOMAINE/Hoist-gzM-Adult/additional_product_images_upload.php:45]

    with mysql version 5.6 everything works fine

    [16-Jan-2019 10:46:56 Europe/Rome] PHP Fatal error: 1364:Field 'category_id' doesn't have a default value :: insert into additional_images
    (products_id, additional_image, status)
    values ('108',
    'additional/myimage.jpg',
    '1') ==> (as called by) /Applications/MAMP/htdocs/MYDOMAINE/ADMIN/additional_product_images_upload.php on line 45 <== in /Applications/MAMP/htdocs/MYDOMAINE/includes/classes/db/mysql/query_factory.php on line 171


    PHP Code:
    $db->Execute("insert into " TABLE_ADDITIONAL_IMAGES "
                        (products_id, additional_image, status)
                        values ('" 
    zen_db_input((int)$_GET['products_id']) . "',
                                '" 
    $additional_image_name "',
                                '1')"
    ); 
    Thanks for your help

  3. #3
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default Re: Additional Product Images WITH MYSQL 5.7.23 does not work

    It worked!!

    You are a magician Thanks
    How did you understand that I had to put null default value of null to categories_id?

    I confirm it works also with the lower version mysql 5.5 and 5.6
    Thanks ZZZ if one day passes from Brussels contact me we take a coffee
    Last edited by diamond1; 16 Jan 2019 at 12:44 PM.
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  4. #4
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Additional Product Images WITH MYSQL 5.7.23 does not work

    It was not that hard, as it is a common problem on newer mysql versions.
    By the way it should be 0, not null, as the field expects an integer, and null is not an integer.

    Thanks for the invitation .

 

 

Similar Threads

  1. Additional Images does not show on product page
    By XxDrAg0nxX in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 23 May 2009, 04:00 PM
  2. Ultimate SEO URLs Does Not Work with Categories with Only One Product
    By hossbronco in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 17 Oct 2008, 04:03 AM
  3. USPS Does not work with Zone selected
    By Hound in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Jan 2008, 05:43 AM
  4. Does ZC work with MySql 5.x?
    By ckosloff in forum Installing on a Windows Server
    Replies: 9
    Last Post: 9 May 2007, 03:08 PM

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