Zen Cart Logo
Forums / General Questions / PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

Views: 837

Results 1 to 10 of 10
23 Jan 2021, 10:01 AM
#1
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

HI

I know I have done this before successfully but now encountered a problem.

I have reinstalled v1.5.7b and added the demo data. From my existing v1.5.1 database I have downloaded sql copies of categories and categories-description.

Then in v1.5.7b I have emptied both those tables and imported the two sql files.

Whereas it used to work before I am getting the category listing at the top of the page as expected but then it crashes with:

WARNING: An Error occurred, please refresh the page and try again.

The error log is showing:

[23-Jan-2021 09:40:19 UTC] Request URI: /booksense_library/, IP address: 86.140.235.144
#1 trigger_error() called at [/home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/home/booksens/public_html/booksense_library/includes/functions/sessions.php:77]
#5 _sess_write()
#6 session_write_close()
--> PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert into sessions (sesskey, expiry, value)
values ('4ade2b53a829a09e79b1e2e36034f772', 1611396259, 'c2VjdXJpdHlUb2tlbnxzOjMyOiJiODIwOWU3YTlkYmE4ODJjMGUzNTI3NTQ2MzBhYmZhMiI7Y3VzdG9tZXJzX2hvc3RfYWRkcmVzc3xzOjQ4OiJob3N0ODYtMTQwLTIzNS0xNDQucmFuZ2U4Ni0xNDAuYnRjZW50cmFscGx1cy5jb20iO2NhcnRJRHxzOjA6IiI7Y2FydHxPOjEyOiJzaG9wcGluZ0NhcnQiOjE0OntzOjg6ImNvbnRlbnRzIjthOjA6e31zOjU6InRvdGFsIjtpOj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b2JzZXJ2ZXJBbGlhc2VzIjthOjE6e3M6Mzc6Ik5PVElGSVlfT1JERVJfQ0FSVF9TVUJUT1RBTF9DQUxDVUxBVEUiO3M6MzY6Ik5PVElGWV9PUkRFUl9DQVJUX1NVQlRPVEFMX0NBTENVTEFURSI7fX1jaGVja192YWxpZF9wcm9kfGI6MTtuYXZpZ2F0aW9ufE86MTc6Im5hdmlnYXRpb25IaXN0b3J5IjozOntzOjQ6InBhdGgiO2E6MTp7aTowO2E6NDp7czo0OiJwYWdlIjtzOjU6ImluZGV4IjtzOjQ6Im1vZGUiO3M6NjoiTk9OU1NMIjtzOjM6ImdldCI7YTowOnt9czo0OiJwb3N0IjthOjA6e319fXM6ODoic25hcHNob3QiO2E6MDp7fXM6MjE6IgBiYXNlAG9ic2VydmVyQWxpYXNlcyI7YToxOntzOjM3OiJOT1RJRklZX09SREVSX0NBUlRfU1VCVE9UQUxfQ0FMQ1VMQVRFIjtzOjM2OiJOT1RJRllfT1JERVJfQ0FSVF9TVUJUT1RBTF9DQUxDVUxBVEUiO319bGFuZ3VhZ2V8czo3OiJlbmdsaXNoIjtsYW5ndWFnZXNfaWR8aToxO2xhbmd1YWdlc19jb2RlfHM6MjoiZW4iO2xheW91dFR5cGV8czo2OiJsZWdhY3kiO2N1cnJlbmN5fHM6MzoiVVNEIjt0b2RheV9pc3xzOjEwOiIyMDIxLTAxLTIzIjt1cGRhdGVFeHBpcmF0aW9uc3xiOjE7YW50aXNwYW1fZmllbGRuYW1lfHM6MTA6ImtsdEZkV0JwbkciO3Nlc3Npb25fY291bnRlcnxiOjE7Y3VzdG9tZXJzX2lwX2FkZHJlc3N8czoxNDoiODYuMTQwLjIzNS4xNDQiOw==', expiry=1611396259 ==> (as called by) /home/booksens/public_html/booksense_library/includes/functions/sessions.php on line 77 <== in /home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php on line 170.

I'm sure there is a simple solution!

Thanks

23 Jan 2021, 12:16 PM
#2
swguy avatar

swguy

Administrator

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

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

Don't upload session table data. Create the table but don't populate it.

That Software Guy. My Store: Zen Cart Support
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.

23 Jan 2021, 12:59 PM
#3
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

swguy:

Don't upload session table data. Create the table but don't populate it.

I haven't uploaded the sessions table and that table is already showing as empty.

23 Jan 2021, 1:34 PM
#4
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

Tried this also by reinstalling v1.7.5b without loading demo data - uploaded my categories and descriptions and still the same error.

It created its own session in the table but with removed still nothing

23 Jan 2021, 1:57 PM
#5
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

Also tried installing v1.5.6 and still the same error - for some reason it dos not like data from v1.5.1

23 Jan 2021, 3:36 PM
#6
carlwhat avatar

carlwhat

zennedOut

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

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

AndreaBastille:

From my existing v1.5.1 database I have downloaded sql copies of categories and categories-description.

Then in v1.5.7b I have emptied both those tables and imported the two sql files....

Also tried installing v1.5.6 and still the same error - for some reason it dos not like data from v1.5.1

i would suggest looking closely at those 2 sql copies. perhaps they are doing a drop table if exists? are you getting this error prior to importing those sql files?

i'm guessing there was some structure change to those tables, and they were not converted.... but merely a guess..

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

23 Jan 2021, 3:51 PM
#7
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

carlwhat:

i would suggest looking closely at those 2 sql copies. perhaps they are doing a drop table if exists? are you getting this error prior to importing those sql files?

i'm guessing there was some structure change to those tables, and they were not converted.... but merely a guess..

best.

I edited the SQL's and removed previous table creates - there are no drop table commands. Not getting the error prior to importing and know that this has worked in the past

23 Jan 2021, 4:06 PM
#8
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

Appears to be a problem with the host :

[23-Jan-2021 13:55:06 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16384 bytes) in /home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php on line 45

23 Jan 2021, 4:08 PM
#9
carlwhat avatar

carlwhat

zennedOut

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

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

AndreaBastille:

Appears to be a problem with the host :

[23-Jan-2021 13:55:06 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16384 bytes) in /home/booksens/public_html/booksense_library/includes/classes/db/mysql/query_factory.php on line 45

yes.

there is also an update to v156:

ALTER TABLE categories MODIFY categories_image varchar(255) default NULL;

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

23 Jan 2021, 4:46 PM
#10
andreabastille avatar

andreabastille

New Zenner

Join Date:
Jan 2021
Location:
UK
Posts:
18
Plugin Contributions:
0

Re: PHP Fatal error: 2014:Commands out of sync; you can't run this command now :: insert

carlwhat:

yes.

there is also an update to v156:

ALTER TABLE categories MODIFY categories_image varchar(255) default NULL;

That table is already set like that