Thread: SQL Error

Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jun 2006
    Posts
    32
    Plugin Contributions
    0

    Default SQL Error

    Recently installed the latest version of Zen Cart on the following setup:

    FreeBSD 6.1
    PHP 5.1.2
    MySQL 5.1.2

    Install went as expected, but the product page shows nothing but a SQL error:

    1054 - Unknown column 'p.products_id' in 'on clause'

    I did a little research on the web and found this thread regarding the same error in osCommerce:

    http//www.oscommerce.com/community/bugs,3171/category,Installation+&+Configuration

    where I learned about the new, stricter JOIN syntax. I then made the following changes to includes/modules/meta_tags.php :

    Code:
    > diff -Nu meta_tags.php.old meta_tags.php
    --- meta_tags.php.old   Mon Jun 12 03:19:12 2006
    +++ meta_tags.php       Mon Jun 12 03:17:59 2006
    @@ -161,7 +161,7 @@
                                           p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
                                           pd.products_description,
                                           mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
    -                              from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd on mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    +                              from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd on mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                   where p.products_id = '" . (int)$_GET['products_id'] . "'
                                   and p.products_id = pd.products_id
                                   and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    And the product page now displays correctly without the error. I assume this JOIN syntax bug exists elsewhere in the code base and will show itself in MySQL 5 installations. However, my Zen Cart experience has lasted about 30 minutes thus far.
    Last edited by DrByte; 12 Jun 2006 at 07:48 PM. Reason: remove active link to external site

 

 

Similar Threads

  1. v139h DB/SQL Error when using SQL Patch for Add Pages More Info Sidebox addon
    By maperr55 in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 5 Mar 2012, 09:32 PM
  2. Replies: 1
    Last Post: 25 Aug 2011, 05:58 AM
  3. Error message 1064 you have an error in your sql syntax
    By honrheart in forum General Questions
    Replies: 1
    Last Post: 11 Sep 2009, 02:38 AM
  4. MySQL Error 1064 You have an error in your SQL syntax;
    By dmm2020 in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 05:02 AM
  5. error message 1064 you have an error in your sql syntax
    By ngsl in forum General Questions
    Replies: 0
    Last Post: 22 Aug 2008, 06:44 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