Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Dynamic dropdowns for SBA db error(db prefix missing)

    Hi there everyone,

    Latest mods on latest cart. I ran the upgrade files for the dynamic dropdown via the SQL patch page upload feature, which I think may have neglected to add the proper db prefix somewhere. When I visit a product page, I receive the following error where the dropdown belongs:

    1146 Table 'store.products_with_attributes_stock' doesn't exist
    in:
    [SELECT quantity FROM products_with_attributes_stock AS a LEFT JOIN products_attributes AS b ON (b.options_id=3 AND b.options_values_id=29) WHERE a.products_id = '796' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order]
    Which makes sense because my table is named "137_products_with_attributes_stock" and not "products_with_attributes_stock"

    I'm afraid to rerun the patches another way without talking to someone first and I can't find any reference to this table in the sql patches that come with the mod.

    Any help would be greatly appreciated as I've got a client's site disabled until resolved.

    thanks,
    json

  2. #2
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Re: Dynamic dropdowns for SBA db error(db prefix missing)

    Ok, pretty sure I found the cause, but still a problem:

    Instructions state:

    5. Modify "includes/database_tables.php" by adding...

    define('TABLE_PRODUCTS_STOCK', 'products_with_attributes_stock');
    When it should actually be:

    5. Modify "includes/database_tables.php" by adding...

    define('TABLE_PRODUCTS_STOCK', DB_PREFIX . 'products_with_attributes_stock');
    So I changed it in database_tables.php and reuploaded. Problem is, refreshing the page shows that it's still trying to pull from the table sans prefix.

    Is there some db cache that I have to flush to see the changes?

    thanks,
    json

  3. #3
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Re: Dynamic dropdowns for SBA db error(db prefix missing)

    Found it in pad_multiple_dropdowns.php:

    Code:
                   $attribute_stock_query = $db->Execute("SELECT quantity FROM products_with_attributes_stock AS a LEFT JOIN products_attributes AS b ON (b.options_id=". (int)$attributes[$o]['oid'] ." AND b.options_values_id=".(int)$attributes[$o]['ovals'][$a]['id'].") WHERE a.products_id = '" . (int)$this->products_id . "' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order");
    Can't wait to see what other surprises are in store with this mod.

    thanks,
    json

  4. #4
    Join Date
    May 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Dynamic dropdowns for SBA db error(db prefix missing)

    Hello,

    I am having the exact same problem and cannot resolve it. This is the error message i am getting:

    1146 Table 'plussize_zc1.products_with_attributes_stock' doesn't exist
    in:
    [SELECT quantity FROM plussize_zc1.products_with_attributes_stock AS a LEFT JOIN products_attributes AS b ON (b.options_id=1 AND b.options_values_id=15) WHERE a.products_id = '8' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order]

    I have edited the database_tables.php as suggested and the line i have added now looks like:

    define('TABLE_PRODUCTS_STOCK', plussize_zc1 . 'products_with_attributes_stock');

    My db name is plussize_zc1

    I have also then tried editing the pad_multiple_dropdowns.php to match the db name. this now reads:

    $attribute_stock_query = $db->Execute("SELECT quantity FROM plussize_zc1.products_with_attributes_stock AS a LEFT JOIN products_attributes AS b ON (b.options_id=". (int)$attributes[$o]['oid'] ." AND b.options_values_id=".(int)$attributes[$o]['ovals'][$a]['id'].") WHERE a.products_id = '" . (int)$this->products_id . "' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order");

    I have no idea what to do here. I didnt do a backup by mistake and now the website is messed up.

    Can anybody PLEASE suggest what i can do or where i might be going wrong?

    Thanks

  5. #5
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Re: Dynamic dropdowns for SBA db error(db prefix missing)

    Hi there plussized,

    What I did wasn't adding the db name at the front. The problem I was having was that I used a table prefix on cart install(in my case, 137_), so all the tables in the database had 137_ in front of them. Instead of putting your database name there, you should check to see whether you need to add a prefix to the code.

    thanks,
    json

 

 

Similar Threads

  1. v151 Sale Maker, SBA & Dynamic Dropdowns
    By MountainUTV in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 30 Aug 2014, 09:11 AM
  2. My admin area is missing all of the dropdowns!
    By rinedesign in forum Customization from the Admin
    Replies: 2
    Last Post: 20 Oct 2010, 06:07 AM
  3. Dynamic Drop Downs for SBA, How do I set a Dropdown to sequenced_dropdown?
    By agent_44 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Mar 2010, 02:48 AM
  4. Dynamic Drop Downs for SBA
    By laurenjj in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 23 May 2009, 10:42 PM
  5. Dynamic Dropdowns For Stock By Attributes
    By Craig Robbo in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 19 Jan 2009, 07:24 AM

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