Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Jun 2013
    Location
    UK
    Posts
    49
    Plugin Contributions
    0

    database error PHP Fatal error: 1109: Unknown table 'p' in field list

    I constantly get the following error after 24/48 hours on my site which prevents both the site and admin areas from functioning at all. This requires a complete reinstall of ZenCart, and a restore of the database.

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


    I have used the Developers toolkit to search for 'select count(p.products_id) as total' and this is not found, I have also used Dreamweaver to search the entire site and this is not found in any file. I am unsure why this being thrown-up but maybe somebody here has encountered this problem and/or can advise how I overcome this problem.

    Bob

  2. #2
    Join Date
    Jun 2013
    Location
    UK
    Posts
    49
    Plugin Contributions
    0

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Hi All,

    I have discovered that this problem is thrown up ONLY when somebody clicks the 'All Products' link on the site!

    Any help would be much appreciated.

  3. #3
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Quote Originally Posted by bobc View Post
    Hi All,

    I have discovered that this problem is thrown up ONLY when somebody clicks the 'All Products' link on the site!

    Any help would be much appreciated.
    and what modules have you installed??? because this is likely some issue cause by a bad module install versus Zen Cart out the box..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Are you able to reproduce this error every time you you click on All Products?

    And each time, does it generate the exact same debug log that you posted:
    Code:
    PHP Fatal error:  1109:Unknown table 'p' in field list :: select  count(p.products_id) as total  ==> (as called by)  /home/black137/public_html/includes/classes/split_page_results.php on  line 78 <== in  /home/black137/public_html/includes/classes/db/mysql/query_factory.php  on line 155
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jun 2013
    Location
    UK
    Posts
    49
    Plugin Contributions
    0

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    In answer to Diva Vocals - The only addon module I have is DHL Express XML.

    In Answer to Ajeh - Yes it is the same error each time the 'All Products' is clicked. And each time it is clicked, I have start again with the ZC Install, and re-import the database! For the moment, I have swithched off the 'All products' Link.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Very odd ... I was expecting this error from either the Product Listing or the Advanced Search or the Search ...

    If you get bored, with nothing to do, and want to hunt this down more, you could make a Test site with a Test database so that this could be examined further ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    You could also try installing myDEBUG Backtrace (http://www.zen-cart.com/downloads.php?do=file&id=1879), which will further identify the errant caller of the split_page_result.php class function.

  8. #8
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Quote Originally Posted by bobc View Post
    Hi All,

    I have discovered that this problem is thrown up ONLY when somebody clicks the 'All Products' link on the site!

    Any help would be much appreciated.
    This error points at includes/classes/split_page_results.php
    line 74 - 78
    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
    echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);


    Clicking that button pulls these files:

    includes/templates/YOUR_TEMPLATE/templates/tpl_products_all_default.php
    line 63
    <div id="allProductsListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>


    includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_all_listing.php
    line 22 - 23 if ($products_all_split->number_of_rows > 0) {
    $products_all = $db->Execute($products_all_split->sql_query);includes/modules/pages/products_all/header_php.php
    line 66
    if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {


    What are the chances your template changed any of these files or what happens when you switch back to the classic template with the products_all turned on?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

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

    Default Re: PHP Fatal error: 1109: Unknown table 'p' in field list

    Additionally, in Admin->Configuration->Maximum Values, what's your setting for Maximum Display of Products All Page ?
    And also all the settings in Admin->Configuration->All Listing ?
    .

    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.

  10. #10
    Join Date
    Dec 2016
    Location
    Washington
    Posts
    106
    Plugin Contributions
    0

    Default Re: zen cart PHP Fatal error: 1109:Unknown table 'p' in field list

    Quote Originally Posted by twitchtoo View Post
    This error points at includes/classes/split_page_results.php
    line 74 - 78
    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
    echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);


    Clicking that button pulls these files:

    includes/templates/YOUR_TEMPLATE/templates/tpl_products_all_default.php
    line 63
    <div id="allProductsListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>


    includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_all_listing.php
    line 22 - 23 if ($products_all_split->number_of_rows > 0) {
    $products_all = $db->Execute($products_all_split->sql_query);includes/modules/pages/products_all/header_php.php
    line 66
    if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {


    What are the chances your template changed any of these files or what happens when you switch back to the classic template with the products_all turned on?
    I have the same problem when “All products or Special products” are clicked
    I am using Winchester responsive template, Zen cart v1.5.5d, Ceon Advanced Shipper 5.0.2 and Sitemap XML
    Lines 74-78 in includes/classes/split_page_results.php show:
    Code:
    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
      echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);
    includes/templates/YOUR_TEMPLATE/templates/tpl_products_all_default.php shows:
    Code:
    <div class="centerColumn" id="allProductsDefault">
    <h1 id="allProductsDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
    <?php
    require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_listing_display_order.php');
    require($template->get_template_dir('tpl_modules_product_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_product_listing.php');
    ?>
    </div>
    lines 22-23 in includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_all_listing.php shows:
    Code:
    if ($products_all_split->number_of_rows > 0) {
      $products_all = $db->Execute($products_all_split->sql_query);
    
    includes/modules/pages/products_all/header_php.php
    line 66-74 shows:
    
    if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
      $show_top_submit_button = true;
    } else {
      $show_top_submit_button = false;
    }
    if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
      $show_bottom_submit_button = true;
    } else {
      $show_bottom_submit_button = false;
    }
    If I change to the default template, the products display fine without a myDEBUG error.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v139h 1109 Unknown table 'p' in field list
    By Dexter71 in forum General Questions
    Replies: 2
    Last Post: 12 Sep 2013, 07:11 PM
  2. Replies: 2
    Last Post: 20 Dec 2012, 07:31 PM
  3. Product Filter Module - 1109:Unknown table 'p' in field list
    By moesoap in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 28 May 2012, 01:40 PM
  4. Replies: 5
    Last Post: 7 Nov 2010, 03:57 AM
  5. Links manager error 1109 Unknown table 'p' in field list
    By ctcentralinfo in forum General Questions
    Replies: 7
    Last Post: 27 Sep 2006, 10:10 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