Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Duplicate Mysql query

    Quote Originally Posted by lat9 View Post
    @mc12345678, The "duplicate key" issue that was corrected in Zen Cart 1.5.5a had to do with the sessions table, not the cache table.
    Actually, both were addressed in ZC 1.5.5 (not saying specifically 1.5.5 versus 1.5.5a, but at least in that "series").

    A/the solution was identified back in the middle to end of 2014 before ZC 1.5.4 was officially released. Then it was not incorporated in ZC 1.5.4, but was referenced as a bug in ZC 1.5.4 (but also backwards to other versions of ZC), which means that "officially" it wouldn't make it into the released core until the next version, dated change, or other release. In this case ZC 1.5.5ish. For me and why I couldn't recall the specifics was the pre-ZC 1.5.4 discovery and correction that didn't make it into ZC 1.5.4, but having both encountered the issue and taken part in testing of it against ZC 1.5.1, 1.5.3, and 1.5.4, well forgot the incorporation date/version, but remembered to which/where it related.

    So, I'm not sure to which sessions "correction" you are referring, but of the solutions posted and existing code, I'm not visually seeing a difference in the "resolution". Maybe I need new eyes or a bigger screen.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: Duplicate Mysql query

    Apologies, mc12345678, I was going on the fact that the majority of the reported issues were present with the sessions table rather than the cache (although I see that both have been changed since ZC1.5.3).

    @Pauls, you could use your admin's Tools->Developers Tool Kit to search for TABLE_DB_CACHE in all your store's .php files; perhaps there's a remnant of the previous handling (i.e. INSERT INTO rather than INSERT IGNORE INTO) that table.
    Last edited by lat9; 24 Jul 2016 at 04:53 PM. Reason: Corrected table name

  3. #13
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by lat9 View Post
    @Pauls, it would help if you would post the full debug-log contents. Zen Cart 1.5.5a includes the myDebug Backtrace handling that will display a backtrace (i.e. which PHP modules were in the calling sequence when the error occurred).

    @mc12345678, The "duplicate key" issue that was corrected in Zen Cart 1.5.5a had to do with the sessions table, not the cache table.
    Hi Lat9
    here is a full log .. today there have been 42 such logs ... similar amount yesterday too!

    [24-Jul-2016 18:53:21 Europe/] Request URI: /index.php?main_page=products_all, IP address: 188.***.***.***
    #1 trigger_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:167]
    #2 queryFactory->show_error() called at [ /public_html/includes/classes/db/mysql/query_factory.php:139]
    #3 queryFactory->set_error() called at [ /public_html/includes/classes/db/mysql/query_factory.php:266]
    #4 queryFactory->Execute() called at [ /public_html/includes/classes/split_page_results.php:78]
    #5 splitPageResults->__construct() called at [ /public_html/includes/modules/responsive_sheffield_blue/product_listing.php:35]
    #6 include( /public_html/includes/modules/responsive_sheffield_blue/product_listing.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_modules_product_listing.php:14]
    #7 require( /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_modules_product_listing.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_products_all_default.php:18]
    #8 require( /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_products_all_default.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php:251]
    #9 require( /public_html/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php) called at [ /public_html/index.php:97]

    [24-Jul-2016 18:53:21 Europe/London] PHP Fatal error: 1109:Unknown table 'p' in field list :: select count(p.products_id) as total ==> (as called by) /public_html/includes/classes/split_page_results.php on line 78 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167

  4. #14
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by lat9 View Post
    Apologies, mc12345678, I was going on the fact that the majority of the reported issues were present with the sessions table rather than the cache (although I see that both have been changed since ZC1.5.3).

    @Pauls, you could use your admin's Tools->Developers Tool Kit to search for TABLE_DB_CACHE in all your store's .php files; perhaps there's a remnant of the previous handling (i.e. INSERT INTO rather than INSERT IGNORE INTO) that table.
    Cheers, will give this a go right away.

    /public_html/admin/includes/init_includes/init_database.php

    Line #39 : $sql = "SHOW TABLES LIKE '" . TABLE_DB_CACHE . "'";

    /public_html/includes/classes/cache.php

    Line # 36 : $sql = "select * from " . TABLE_DB_CACHE . " where cache_entry_name = '" . $zp_cache_name . "'";

    Line # 66 : $sql = "select * from " . TABLE_DB_CACHE . " where cache_entry_name = '" . $zp_cache_name ."'";

    Line # 95 : $sql = "delete from " . TABLE_DB_CACHE . " where cache_entry_name = '" . $zp_cache_name . "'";

    Line #122 : $sql = "select * from " . TABLE_DB_CACHE . " where cache_entry_name = '" . $zp_cache_name . "'";

    Line #128 : $sql = "insert ignore into " . TABLE_DB_CACHE . " (cache_entry_name, cache_data, cache_entry_created) VALUES (:cachename, :cachedata, unix_timestamp() )";

    Line #154 : $sql = "select * from " . TABLE_DB_CACHE . " where cache_entry_name = '" . $zp_cache_name . "'";

    Line #184 : $sql = "delete from " . TABLE_DB_CACHE;

    /public_html/includes/database_tables.php

    Line # 45 : define('TABLE_DB_CACHE', DB_PREFIX . 'db_cache');

    /public_html/includes/init_includes/init_database.php

    Line #47 : $sql = "SHOW TABLES LIKE '" . TABLE_DB_CACHE . "'";

    I changed the admin folder name, this was a search of 1449 files and found the 10 matches above.
    Last edited by Pauls; 24 Jul 2016 at 08:43 PM. Reason: Results of the suggested search

  5. #15
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Duplicate Mysql query

    It seems that either or both of these files are not current:
    /includes/classes/cache.php
    /includes/functions/sessions.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by DrByte View Post
    It seems that either or both of these files are not current:
    /includes/classes/cache.php
    /includes/functions/sessions.php
    Hi thanks for your reply, here are screenshots of a comparison between the two files, each from the original expanding zip file containing ZC1.5.5a files, the other from the server live
    Click image for larger version. 

Name:	cachephp.jpg 
Views:	34 
Size:	25.6 KB 
ID:	16527

    Click image for larger version. 

Name:	sessionsphp.jpg 
Views:	41 
Size:	27.0 KB 
ID:	16528

    The sessions file had line endings that were different I have no idea why or how that could happen, nonetheless I have overwritten the sessions.php file with the one from the 1.5.5a version of zencart.
    Last edited by Pauls; 25 Jul 2016 at 09:44 AM.

  7. #17
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by Pauls View Post
    Hi thanks for your reply, here are screenshots of a comparison between the two files, each from the original expanding zip file containing ZC1.5.5a files, the other from the server live
    Click image for larger version. 

Name:	cachephp.jpg 
Views:	34 
Size:	25.6 KB 
ID:	16527

    Click image for larger version. 

Name:	sessionsphp.jpg 
Views:	41 
Size:	27.0 KB 
ID:	16528

    The sessions file had line endings that were different I have no idea why or how that could happen, nonetheless I have overwritten the sessions.php file with the one from the 1.5.5a version of zencart.
    RE: my last reply, I need to check something ... I will reply shortly.

    Looks OK thought I had checked the wrong files, all is good .... now I will check the server for errors shortly.
    Last edited by Pauls; 25 Jul 2016 at 09:50 AM. Reason: Checking files

  8. #18
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    OK here is an error in the log file, after checking after re-uploading the above two files again.

    #1 trigger_error() called at [ /public_html/includes/classes/db/mysql/query_factory.php:167]
    #2 queryFactory->show_error() called at [ /public_html/includes/classes/db/mysql/query_factory.php:139]
    #3 queryFactory->set_error() called at [ /public_html/includes/classes/db/mysql/query_factory.php:266]
    #4 queryFactory->Execute() called at [ /public_html/includes/classes/split_page_results.php:78]
    #5 splitPageResults->__construct() called at [ /public_html/includes/modules/responsive_sheffield_blue/product_listing.php:35]
    #6 include( /public_html/includes/modules/responsive_sheffield_blue/product_listing.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_modules_product_listing.php:14]
    #7 require( /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_modules_product_listing.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_products_all_default.php:18]
    #8 require( /public_html/includes/templates/responsive_sheffield_blue/templates/tpl_products_all_default.php) called at [ /public_html/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php:251]
    #9 require( /public_html/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php) called at [ /public_html/index.php:97]

    PHP Fatal error: 1109:Unknown table 'p' in field list :: select count(p.products_id) as total ==> (as called by) /public_html/includes/classes/split_page_results.php on line 78 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167

  9. #19
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Duplicate Mysql query

    These recent errors relate to how the template was installed and in relation to its use on ZC 1.5.5... that issue is documented frequently in the forum for Responsive Sheffield Blue. I can't recall if it is because of a lack of uploading the split_page_results file from the plugin, or if because it was... there are a few notes though about incorporating that template, some if not all are identified in this thread: https://www.zen-cart.com/showthread....rk-with-v1-5-5
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #20
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by mc12345678 View Post
    These recent errors relate to how the template was installed and in relation to its use on ZC 1.5.5... that issue is documented frequently in the forum for Responsive Sheffield Blue. I can't recall if it is because of a lack of uploading the split_page_results file from the plugin, or if because it was... there are a few notes though about incorporating that template, some if not all are identified in this thread: https://www.zen-cart.com/showthread....rk-with-v1-5-5
    Thanks again MC I will take a look at the RSB thread again, I did look but it's massive and information there is a year old in some cases so I am not sure whether to change files or not based on someone's issue 12 months ago if you see what I mean as I would have thought those issues would have been addressed in version 2.0 of the theme.

    I don't want to give up on the RSB theme as it looks and works fab.

    The thread you posted looks like it has potential, thanks I will have a scan through and try a few suggestions.
    Last edited by Pauls; 25 Jul 2016 at 12:21 PM.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v155 Help with a MySQL query
    By lat9 in forum General Questions
    Replies: 7
    Last Post: 26 Apr 2016, 10:11 PM
  2. mySQL Query of all Products
    By Keitex in forum General Questions
    Replies: 1
    Last Post: 5 Oct 2011, 02:25 AM
  3. How do I run a MySQL Query ?
    By HeyIts007 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 May 2011, 07:40 PM
  4. mysql query issue
    By Andy_GS in forum General Questions
    Replies: 0
    Last Post: 16 Mar 2009, 01:53 PM
  5. [Duplicate] 1.3.8 Query parameters missing.
    By JCakeC in forum Bug Reports
    Replies: 2
    Last Post: 12 Apr 2008, 04:31 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