Zen Cart Logo
Forums / PayPal Express Checkout support / PHP Fatal error: 1366:Incorrect integer value

PHP Fatal error: 1366:Incorrect integer value

Views: 21,543

Results 21 to 39 of 39
1 Jan 2021, 2:40 PM
#21
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

PHP Fatal error: 1366:Incorrect integer value

Those changes should be OK-fine! Happy 2021 to all!

1 Jan 2021, 11:41 PM
#22
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: PHP Fatal error: 1366:Incorrect integer value

Thank you.

I made those changes, yet I get same error: Warning: An error occured, please refresh the page and try again.

Any other suggestions please?

1 Jan 2021, 11:47 PM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PHP Fatal error: 1366:Incorrect integer value

keneso:

Thank you.

I made those changes, yet I get same error: Warning: An error occured, please refresh the page and try again.

Any other suggestions please?
The on screen message is generic on purpose, don't want to provide the details of the problem(s) to just anyone... The real cause is in the myDEBUG log file(s) that were generated... Please return to them and see what else is likely an issue now...

2 Jan 2021, 12:31 AM
#24
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: PHP Fatal error: 1366:Incorrect integer value

Thank you.

Sorry for creating confusion, besides the on screen message, I should have specified that the debug reports the same as my previous post #20

2 Jan 2021, 12:39 AM
#25
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: PHP Fatal error: 1366:Incorrect integer value

keneso:

Mid december there was a migration done by hosting company to new server, before that everything was working fine, meaning orders would get in after payment.

--> PHP Fatal error: 1366:Incorrect integer value: '' for column tesoreri_zen156c.orders.delivery_address_format_id at row 1 :: INSERT INTO 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 ('100', 'NAME REMOVED', '', 'ADDRESS REMOVED', '', 'TOWN REMOVED', 'ZIP REMOVED', 'STATE REMOVED', 'COUNTRY REMOVED', 'PHONE REMOVED', 'MAIL REMOVED', '5', ' ', '', '', '', '', '', '', '', '', 'NAME REMOVED', '', 'ADDRESS REMOVED', '', 'TOWN REMOVED', 'ZIP REMOVED', 'STATE REMOVED', 'COUNTRY REMOVED', '5', 'PayPal', 'paypalwpp', 'free_free', 'free', '', '', '', '', '', now(), '2', '50', '0', 'EUR', '1.000000', 'xxx.xxx.xxx.xxx - xxx.xxx.xxx.xxx')

It seems your new server is using a much newer MySQL version. And newer MySQL versions have "strict mode" enabled by default. I'm guessing your old server used an older version and/or had strict mode turned off, whether intentionally or as a byproduct of the old version's defaults.

While most of v1.5.7's code has been adapted to accommodate such issues, your 1.5.6 site won't have those benefits. Until you get your code upgraded, you could temporarily turn strict mode off in your MySQL. This is not recommended, but it's a bandage until you do the very important upgrade to make your Zen Cart compatible with the new server you've begun using.

2 Jan 2021, 12:48 AM
#26
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: PHP Fatal error: 1366:Incorrect integer value

Thank you.
Looks like I have to reschedule some jobs.

13 Jan 2021, 10:21 AM
#27
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: PHP Fatal error: 1366:Incorrect integer value

While in process to prepare for upgarde I asked hosting, and they removed strict mode, and it worked for one transaction.

Couple days ago there was yet another transaction which failed, meaning no orders in admin, and no emails, but funds in PayPal account.

Thank you

17 Oct 2021, 1:53 PM
#28
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: PHP Fatal error: 1366:Incorrect integer value

Hi Guys trying to reset all products master master directory ids in 1.5.7c php 7.4 mysql 5.7 (ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION)
I get PHP Fatal error: 1366:Incorrect integer value as shown in the log below.

[17-Oct-2021 13:25:56 UTC] Request URI: /admin/index.php?cmd=store_manager&action=update_all_master_categories_id, IP address: xx.xx.xx.xx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/admin/store_manager.php:175]
#5 require(/admin/store_manager.php) called at [/admin/index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'master_categories_id' at row 1 :: UPDATE products SET master_categories_id='' WHERE products_id='2691' ==> (as called by) /admin/store_manager.php on line 175 <== in /includes/classes/db/mysql/query_factory.php on line 170.

17 Oct 2021, 2:22 PM
#29
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: PHP Fatal error: 1366:Incorrect integer value

Georgecy:

Hi Guys trying to reset all products master master directory ids in 1.5.7c php 7.4 mysql 5.7 (ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION)
I get PHP Fatal error: 1366:Incorrect integer value as shown in the log below.

[17-Oct-2021 13:25:56 UTC] Request URI: /admin/index.php?cmd=store_manager&action=update_all_master_categories_id, IP address: xx.xx.xx.xx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/admin/store_manager.php:175]
#5 require(/admin/store_manager.php) called at [/admin/index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'master_categories_id' at row 1 :: UPDATE products SET master_categories_id='' WHERE products_id='2691' ==> (as called by) /admin/store_manager.php on line 175 <== in /includes/classes/db/mysql/query_factory.php on line 170.
You'll need to perform some "database surgery", since it appears that the product with id=2691 doesn't have an associated record in the products_to_categories table.

If you inspect that product via phpMyAdmin, what shows as its master_categories_id? Is it a valid categories_id? If so, you can simply add a record to the products_to_categories table that associates products_id 2691 to its master_categories_id.

17 Oct 2021, 2:39 PM
#30
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: PHP Fatal error: 1366:Incorrect integer value

You may be able to track down some of these anomalies using the Audit tool:

https://www.zen-cart.com/downloads.php?do=file&id=2261

17 Oct 2021, 2:39 PM
#31
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PHP Fatal error: 1366:Incorrect integer value

Georgecy:

Hi Guys trying to reset all products master master directory ids in 1.5.7c php 7.4 mysql 5.7 (ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION)
I get PHP Fatal error: 1366:Incorrect integer value as shown in the log below.

[17-Oct-2021 13:25:56 UTC] Request URI: /admin/index.php?cmd=store_manager&action=update_all_master_categories_id, IP address: xx.xx.xx.xx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/admin/store_manager.php:175]
#5 require(/admin/store_manager.php) called at [/admin/index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'master_categories_id' at row 1 :: UPDATE products SET master_categories_id='' WHERE products_id='2691' ==> (as called by) /admin/store_manager.php on line 175 <== in /includes/classes/db/mysql/query_factory.php on line 170.

While the existence of the log is likely because of strict mode, the real problem is that product 2691 has an undefined master category. Considering that there are or were some previous 2690 other product in your store, you likely have categories in your store. By having a master category effectively set to 0, that means you have a product within a category that has categories... A central design consideration of Zen Cart is that product are not to exist in a category that has categories. 

That product needs to have its master category changed to one of the categories at the end of a branch. One way to do this is to manually navigate to any product in your store to support editing that product.

Then once on the product edit page, change the browser address so that pID=2691 and load that page.

At the top of the listing, the product likely is assigned to more than one category and a dropdown will be provided with the first option identifying something like an "error" or some other description that I can not remember at the moment. The dropdown is associated with the category(ies) to which it is assigned. Pick one of the other categories, preferably the one to which this product really should be assigned. 

If that dropdown is not available, then the issue is "resolvable" (though I've found not so easily so in more recent versions of ZC) by use of the multiple categories Link manager that in 1.5.7 I find accessible through at least 2 methods. One is to navigate to a category that has product (which shouldnt have a category in it if all things have been managed "properly") and then select to copy a product.

Scroll down to the bottom of the right side window, select the button: Multiple Categories Link Manager.

Then on the right side, click the button: Select Another Product by ID# and then enter in 2691.

Now, from here it is where there may be some difficulties. I haven't sussed out why/when there are problems, but I know that in more recent versions it has not been as user friendly to reassign the master category and/or to add the product to another category so that the master category can be modified/reset. But, there is an option to update the product master category and below that there is an option to link the product to another category. In my past experience with this version of ZC, one or more of these operations just results in error messages either on screen or in the logs directory because of the way it has been reworked to also provide more options and in a way for the code to appear easier to understand. At any rate, should be able to get there after some in store operations instead of having to access the database directly.
17 Oct 2021, 4:26 PM
#32
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: PHP Fatal error: 1366:Incorrect integer value

Thanks a lot,
Based on your instructions I discover more than one disabled product without a master category (Warning: No Master Category ID has been set for this Product). Unfortunately ZC does not allow me to either delete the product(as is not needed) or add the Master category to the product. Any further help will be appreciated.

mc12345678:

While the existence of the log is likely because of strict mode, the real problem is that product 2691 has an undefined master category. Considering that there are or were some previous 2690 other product in your store, you likely have categories in your store. By having a master category effectively set to 0, that means you have a product within a category that has categories... A central design consideration of Zen Cart is that product are not to exist in a category that has categories.

That product needs to have its master category changed to one of the categories at the end of a branch. One way to do this is to manually navigate to any product in your store to support editing that product.

Then once on the product edit page, change the browser address so that pID=2691 and load that page.

At the top of the listing, the product likely is assigned to more than one category and a dropdown will be provided with the first option identifying something like an "error" or some other description that I can not remember at the moment. The dropdown is associated with the category(ies) to which it is assigned. Pick one of the other categories, preferably the one to which this product really should be assigned.

If that dropdown is not available, then the issue is "resolvable" (though I've found not so easily so in more recent versions of ZC) by use of the multiple categories Link manager that in 1.5.7 I find accessible through at least 2 methods. One is to navigate to a category that has product (which shouldnt have a category in it if all things have been managed "properly") and then select to copy a product.

Scroll down to the bottom of the right side window, select the button: Multiple Categories Link Manager.

Then on the right side, click the button: Select Another Product by ID# and then enter in 2691.

Now, from here it is where there may be some difficulties. I haven't sussed out why/when there are problems, but I know that in more recent versions it has not been as user friendly to reassign the master category and/or to add the product to another category so that the master category can be modified/reset. But, there is an option to update the product master category and below that there is an option to link the product to another category. In my past experience with this version of ZC, one or more of these operations just results in error messages either on screen or in the logs directory because of the way it has been reworked to also provide more options and in a way for the code to appear easier to understand. At any rate, should be able to get there after some in store operations instead of having to access the database directly.

17 Oct 2021, 5:15 PM
#33
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PHP Fatal error: 1366:Incorrect integer value

Georgecy:

Thanks a lot,
Based on your instructions I discover more than one disabled product without a master category (Warning: No Master Category ID has been set for this Product). Unfortunately ZC does not allow me to either delete the product(as is not needed) or add the Master category to the product. Any further help will be appreciated.
It is helpful to identify what has been attempted to add/modify the master category. For example, in the checkboxes that are presented, was the product attempted to be linked to another category?
What about back at the products/category listing for the root of the store, does the lone product appear possibly at the last page of categories so that it could be copied as a linked product to another category?

Again, explaining what has been tried (please be as specific as possible) it is eaiser to describe what to try and what may work. I am going to try in a little bit to populate a test store with a product that has an "empty" master category that is not linked elsewhere and see what can be done. This was previously something relatively easily resolved, but in streamlining the code to operate "normally" such issues are now harder to resolve from within the admin.

17 Oct 2021, 6:00 PM
#34
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: PHP Fatal error: 1366:Incorrect integer value

The link manager shows no links. And when trying to move the product in a new category it has no effect. It seems around 10 products which are related have no master category id

17 Oct 2021, 6:51 PM
#35
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: PHP Fatal error: 1366:Incorrect integer value

Did you try following the advice I gave you to use the Audit plugin?

17 Oct 2021, 9:31 PM
#36
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PHP Fatal error: 1366:Incorrect integer value

Georgecy:

The link manager shows no links. And when trying to move the product in a new category it has no effect. It seems around 10 products which are related have no master category id
So, I created a product assigned to the test examples category. I then set the master_categories_id to '' for that product. I then went to Catalog->Categories/Products. Then I typed in the products_id that was associated with that product in the search field. The product appeared in the list. I then copied the product as a linked product to the category desired (at this point it was back to the Test Examples category). I then again went to "copy" the product but this time going to the link manager, I was presented with the product and the ability to change the master category through the dropdown selection.

So, then I followed the consideration previously described by lat9 about the products_to_categories table having bad information. In this case I removed all information from that table associated with my "problem" product. I again reset the master category to ''. So basically, the database would have data that there is a "product" but it isn't associated with anything.

This time, when I went through the copy as a linked product process, it appeared "successful" but the product did not appear anywhere other than by searching on its products_id. I then again attempted to access the link manager from the copy product action, and this time the series of checkboxes did not appear, but the product was shown at the top of the list and that there was an invalid master category assigned.

I admit that in a way I gave up trying to find a way to create a record in the products_to_categories table for this product at this point. But of course I thought, what about possibly moving the product? Nope, that wasn't a success either even though no message was provided on screen. A debug log was generated, but...

When I then added a record to the products_to_categories table for this one product even if it was to the main category I was then able to correct the issue as described above. So, yeah, first thing/important thing is to ensure that the products_id exists in the products_to_categories table in order to move forwards even if correcting this within the admin is otherwise not so easy, it still can be done until those options too are removed.

18 Oct 2021, 12:13 PM
#37
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: PHP Fatal error: 1366:Incorrect integer value

Hi Scott,
Sorry I did not see the initial post but the Audit plug in worked great and solved all the issues. I manage to fix and delete the problematic items and the reset of Master category ids worked without problem.
Thank you all guys for the great work you are doing.

25 Jul 2022, 10:45 AM
#38
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: PHP Fatal error: 1366:Incorrect integer value

Hi Guys, suddenly I can not enter any products in Zencart 1.5.7d. The error is PHP Fatal error: 1366:Incorrect integer value: '' for column 'products_xsell_sort_order' at row 1 and the log is below.
[25-Jul-2022 10:34:34 UTC] Request URI: /macadmin1/index.php?cmd=product&cPath=402&action=insert_product, IP address: xxx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/includes/functions/database.php:44]
#5 zen_db_perform() called at [/admin/includes/modules/update_product.php:72]
#6 require(/admin/includes/modules/update_product.php) called at [/admin/product.php:33]
#7 require(/admin/product.php) called at [/admin1/index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'products_xsell_sort_order' at row 1 :: INSERT INTO products (products_quantity, products_type, products_model, products_xsell_sort_order, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) VALUES ('0', '1', '', '', '84.0336', null, '0', '1', '0', '1', '0', '1', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0', '0', 'Apple Watch 7 + AirPods 2 June Offer CampaignFB.jpg', now(), '402') ==> (as called by) /includes/functions/database.php on line 44 <== in /includes/classes/db/mysql/query_factory.php on line 171.

25 Jul 2022, 2:19 PM
#39
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,956
Plugin Contributions:
8

Re: PHP Fatal error: 1366:Incorrect integer value

Georgecy:

Hi Guys, suddenly I can not enter any products in Zencart 1.5.7d. The error is PHP Fatal error: 1366:Incorrect integer value: '' for column 'products_xsell_sort_order' at row 1 and the log is below.
[25-Jul-2022 10:34:34 UTC] Request URI: /macadmin1/index.php?cmd=product&cPath=402&action=insert_product, IP address: xxx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/includes/functions/database.php:44]
#5 zen_db_perform() called at [/admin/includes/modules/update_product.php:72]
#6 require(/admin/includes/modules/update_product.php) called at [/admin/product.php:33]
#7 require(/admin/product.php) called at [/admin1/index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'products_xsell_sort_order' at row 1 :: INSERT INTO products (products_quantity, products_type, products_model, products_xsell_sort_order, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) VALUES ('0', '1', '', '', '84.0336', null, '0', '1', '0', '1', '0', '1', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0', '0', 'Apple Watch 7 + AirPods 2 June Offer CampaignFB.jpg', now(), '402') ==> (as called by) /includes/functions/database.php on line 44 <== in /includes/classes/db/mysql/query_factory.php on line 171.

the problem looks to be with a paid plugin. specifically this one here:

https://www.thatsoftwareguy.com/zencart_extended_family.html

my guess is that you are running into a problem with mysql strict mode. you can either turn off mysql strict mode, or contact the developer for an updated version.

best.