Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default Location manufacturers_id ?

    Hi,

    if someone is in my shop and click at the products manufacturer, they receive this error:
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from where manufacturers_id = 17' at line 2
    in:
    [select from where manufacturers_id = 17]

    The link is:
    index.php?main_page=index&manufacturers_id=XX

    The error is clear, the query is wrong. So I thought this would be located in the filter: index_filters/default_filter.php

    I replaced it by the original zen-cart file (since mine is modificated) but still the error occurs.

    Where is this query located?

    Thank in advance,

    Streetglow.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Location manufacturers_id ?

    What version of Zen Cart ?
    What addons/contributions are installed?
    What customizations have been done to the site?
    What's the URL ?
    .

    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.

  3. #3
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: Location manufacturers_id ?

    Version 1.3.7.

    Addon: Multisite Module.

    Customizations can't be counted...

    The site is restricted access, resellers only.

    This is how the error occurs:

    In the categories menu they pick a category.
    They will see a product list (products in that category).
    There is a certain row called "manufacturers" if they click at the manufacturer, the purpose is to show all products manufacturered by the request they made.
    The link will be "index.php?main_page=index&manufacturers_id=XX".
    If I know where this query is build I could fix it myself, I am certain of that.

    Thanks for the fast reply DB.

    Streetglow.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Location manufacturers_id ?

    Quote Originally Posted by streetglow View Post
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from where manufacturers_id = 17' at line 2
    in:
    [select from where manufacturers_id = 17]
    The normal syntax would be "select {list of fields} from {list of tables} where ...."

    So, whatever is building it is obviously not properly assembling those components.
    Quote Originally Posted by streetglow View Post
    I thought this would be located in the filter: index_filters/default_filter.php
    That's most likely the correct assumption for a default install.
    It's possible that the multi-site mod has changed the normal behaviour to point elsewhere.
    .

    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.

  5. #5
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: Location manufacturers_id ?

    Ok thanks for the confirmation.
    The strange thing about all this is, at the other site (also using the multisite module) there is no such issue.

    The manufacturers part is still original:
    Code:
    if (PRODUCT_LIST_FILTER > 0)
      {
        if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] != '')
        {
          $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name
          from " . TABLE_PRODUCTS . " p, " .
          TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
          TABLE_CATEGORIES . " c, " .
          TABLE_CATEGORIES_DESCRIPTION . " cd
          where p.products_status = 1
            and p.products_id = p2c.products_id
            and p2c.categories_id = c.categories_id
            and p2c.categories_id = cd.categories_id
            and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
            and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
            AND p.products_site LIKE '%--".SITE_NAME."--%'
          order by cd.categories_name";
        } else {
          $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name
          from " . TABLE_PRODUCTS . " p, " .
          TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
          TABLE_MANUFACTURERS . " m
          where p.products_status = 1
            and p.manufacturers_id = m.manufacturers_id
            and p.products_id = p2c.products_id
            and p2c.categories_id = '" . (int)$current_category_id . "'
            AND p.products_site LIKE '%--".SITE_NAME."--%'
          order by m.manufacturers_name";
        }
        $do_filter_list = false;
        $filterlist = $db->Execute($filterlist_sql);
        if ($filterlist->RecordCount() > 1)
        {
            $do_filter_list = true;
          if (isset($_GET['manufacturers_id']))
          {
            $getoption_set =  true;
            $get_option_variable = 'manufacturers_id';
            $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
          } else {
            $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
          }
          while (!$filterlist->EOF) {
            $options[] = array('id' => $filterlist->fields['id'], 'text' => $filterlist->fields['name']);
            $filterlist->MoveNext();
          }
        }
      }
    Another weird thing is, defaul_filter.php is on both sites identically.

    Any suggestions what file I should take a look at?

    Thanks again for the reply.

    Streetglow.
    Last edited by streetglow; 5 Sep 2007 at 04:08 PM.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Location manufacturers_id ?

    The only place in the code where I see anything as "simple" as the way that query is worded, would be this, from the bottom of the index_filter.php file ... not sure how the components could be blank though ...
    Code:
      if (isset($_GET['manufacturers_id'])) {
        $sql = "select manufacturers_image
                  from   " . TABLE_MANUFACTURERS . "
                  where      manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
    
        $image_name = $db->Execute($sql);
        $image = $image_name->fields['manufacturers_image'];
    .

    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.

  7. #7
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Location manufacturers_id ?

    Maybe somehow TABLE_MANUFACTURERS got deleted ? Check the table definition file.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: Location manufacturers_id ?

    DrByte, I don't really believe this is the case, since the error is this:

    Code:
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from where manufacturers_id = 17' at line 2
    in:
    [select from where manufacturers_id = 17]
    In your case, the error would contain something like:
    [select manufacturers_image from where manufacturers_id = 17]

    Also I tried to comment that code, but it all doesn't help.

    yellow, also this is not the issue I am currently experiencing.
    I tried to re-define the values on top of the index page.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Location manufacturers_id ?

    Quote Originally Posted by streetglow View Post
    DrByte, I don't really believe this is the case
    I agree. However, it doesn't seem logical that it's any of the other queries in index_filter because all of those have hard-coded field names, not driven entirely by variables.

    Thus, I suspect the problem might be located elsewhere.
    A search through your site for "manufacturer_id" or "manufacturer_id =" will bring back a lotta stuff, but if you look at each case and look for a "where" immediately before it, perhaps you'll be closer.
    .

    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
    Jun 2006
    Posts
    21
    Plugin Contributions
    0

    Default Re: Location manufacturers_id ?

    Hi I'm having exactly the ame problem, any chance you got over this issue? could you share the solution? Thanks!!

 

 

Similar Threads

  1. v151 Question regarding $manufacturers_id in tpl_product_info_display.php
    By shirster in forum General Questions
    Replies: 2
    Last Post: 9 Jul 2013, 04:59 AM
  2. v139h Adding Manufacturers_id to Invoice/packing Slip
    By NickyCarroll in forum Customization from the Admin
    Replies: 3
    Last Post: 25 Apr 2012, 10:44 PM
  3. View by manufacturers_id is so slow, why?
    By DigitalShadow in forum General Questions
    Replies: 19
    Last Post: 14 Jan 2012, 02:15 AM
  4. Replies: 0
    Last Post: 13 Oct 2008, 10:08 AM

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