Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2007
    Posts
    5
    Plugin Contributions
    0

    Default Search problem - grid layout maybe?

    Hey, Im getting the following error when searching for a product on my site. Im wondering if its linked to the grid layout modification which I made? any help would be amazing!

    1054 Unknown column 'cd.categories_namecd.categories_description' in 'field list'
    in:
    [SELECT DISTINCT c.categories_image, cd.categories_namecd.categories_description, cd.categories_id, c.parent_id from zen_categories_description cd, zen_categories c where cd.categories_id = c.categories_id and cd.language_id = '1' AND ((cd.categories_name LIKE '%plant%' OR cd.categories_description LIKE '%plant%') ) order by cd.categories_name]

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Search problem - grid layout maybe?

    Posting the same question over and over is frowned upon in this forum. Please read the About Posting guide.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Sep 2008
    Location
    Sweden
    Posts
    94
    Plugin Contributions
    4

    Default Re: Search problem - grid layout maybe?

    Maybe I missed the answer somewere in the forum. So you can move this to the proper place. (this answer is not a version specific answer).

    You got this error message if some column is missing in a database table.

    Example:
    1054 Unknown column 'cd.categories_namecd.categories_description' in 'field list'
    in:
    [SELECT DISTINCT c.categories_image, cd.categories_namecd.categories_description, cd.categories_id, c.parent_id from zen_categories_description cd, zen_categories c where cd.categories_id = c.categories_id and cd.language_id = '1' AND ((cd.categories_name LIKE '%plant%' OR cd.categories_description LIKE '%plant%') ) order by cd.categories_name]

    Whats wrong?:
    here you call for two fields that are missing. categories_name and categories_description. the cd. are pointing to the table zen_categories_description where it say it is cd before the coma.

    This problem is always common when you manualy translate osc database to Zen Cart so if you cant use the translate script you have to compare both database.

    Sometimes you made changes in some file to the database call for some contributions and when you made some new changes it overrun this or overwrite this changes. so it is always important to have a proper backup of the files so you can compare them and manually change it.

  4. #4
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Search problem - grid layout maybe?

    Here is a fix to the problem in Advanced Search Plus:

    Go to line 45 of advanced_search_categories.php, it looks like this:
    $select_str_cat = "SELECT DISTINCT " . $select_column_list . "cd.categories_description, cd.categories_id, c.parent_id ";

    Add a comma and space before cd.categories_description:
    $select_str_cat = "SELECT DISTINCT " . $select_column_list . ", cd.categories_description, cd.categories_id, c.parent_id ";

    Voila - fixed!

  5. #5
    Join Date
    Feb 2011
    Posts
    2
    Plugin Contributions
    1

    Default Re: Search problem - grid layout maybe?

    Forgive my poor formatting, I'm still new at this type of thing. I had a similar issue with the code where the switch would add an extra ", " and it would throw a MySQL 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 ' cd.categories_description, cd.categories_id, c.parent_id from categories_descr' at line 1"

    The Fix:

    In advanced_search_categories:

    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
    if (zen_not_null($select_column_list)) {
    $select_column_list .= ', ';
    }

    Changed to (added "-1" to reduce the iterations of the FOR) :

    for ($col=0, $n=sizeof($column_list)-1; $col<$n; $col++) {
    if (zen_not_null($select_column_list)) {
    $select_column_list .= ', ';
    }

 

 

Similar Threads

  1. Grid layout on New, Featured, All, and Search Results pages
    By candy1245 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Feb 2013, 11:58 PM
  2. [Not a ZC bug] Search problem - grid layout maybe?
    By dhamilton51 in forum Bug Reports
    Replies: 2
    Last Post: 9 Mar 2009, 08:14 PM
  3. Search problem - grid layout maybe?
    By dhamilton51 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 9 Mar 2009, 11:52 AM
  4. Grid Layout Installation Problem
    By Garenthino in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 6 Sep 2007, 04:19 AM
  5. Grid layout problem
    By ekat in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 23 Sep 2006, 04:50 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