Zen Cart Logo
Forums / General Questions / Search error in search box

Search error in search box

Locked

Views: 1,518

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
16 Aug 2006, 11:10 PM
#1
sparktronic avatar

sparktronic

Zen Follower

Join Date:
Nov 2005
Location:
Rochester, New York
Posts:
153
Plugin Contributions:
0

Search error in search box

I am getting this message when typing in a key word:

Advanced Search
1064 You have an error in your SQL syntax near ' p.products_quantity , m.manufacturers_id, p.products_id, pd.products_name, p.p' at line 1
in:
[SELECT DISTINCT , p.products_quantity , m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_price_sorter FROM products p LEFT JOIN manufacturers m USING(manufacturers_id), products_description pd, categories c, products_to_categories p2c LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ((pd.products_name LIKE '%lawyer%' OR p.products_model LIKE '%lawyer%' OR m.manufacturers_name LIKE '%lawyer%' OR (mtpd.metatags_keywords LIKE '%lawyer%' AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description LIKE '%lawyer%' AND mtpd.metatags_description !='') OR pd.products_description LIKE '%lawyer%') ) order by pd.products_name limit 0, 10]

The version of zen cart is the most recent and current, it is a Unix server and the URL is http://alltalktease.com/catalog/

16 Aug 2006, 11:43 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search error in search box

What specific version of Zen Cart are you running?

16 Aug 2006, 11:47 PM
#3
sparktronic avatar

sparktronic

Zen Follower

Join Date:
Nov 2005
Location:
Rochester, New York
Posts:
153
Plugin Contributions:
0

Re: Search error in search box

The version is 1.3.0.2

16 Aug 2006, 11:56 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search error in search box

Sounds like you missed a file ...

What version Zen Cart were you?

How did you upgrade?

Do you see around line 170 - 174 in /includes/modules/pages/index/main_template_vars.php on the server ...

  // always add quantity regardless of whether or not it is in the listing for add to cart buttons
  if (PRODUCT_LIST_QUANTITY < 1) {
    $select_column_list .= 'p.products_quantity, ';
  }

What settings do you have for the Configuration ... Product Listing ...

17 Aug 2006, 12:00 AM
#5
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Search error in search box

sparktronic:

I am getting this message when typing in a key word:

Advanced Search
1064 You have an error in your SQL syntax near ' p.products_quantity , m.manufacturers_id, p.products_id, pd.products_name, p.p' at line 1
in:
[SELECT DISTINCT , p.products_quantity , m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_price_sorter FROM products p LEFT JOIN manufacturers m USING(manufacturers_id), products_description pd, categories c, products_to_categories p2c LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ((pd.products_name LIKE '%lawyer%' OR p.products_model LIKE '%lawyer%' OR m.manufacturers_name LIKE '%lawyer%' OR (mtpd.metatags_keywords LIKE '%lawyer%' AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description LIKE '%lawyer%' AND mtpd.metatags_description !='') OR pd.products_description LIKE '%lawyer%') ) order by pd.products_name limit 0, 10]

The version of zen cart is the most recent and current, it is a Unix server and the URL is http://alltalktease.com/catalog/

Can you paste the corresponding file here?

17 Aug 2006, 12:00 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search error in search box

Also in the /includes/modules/pages/advanced_search_results/header_php.php around line 185 - 192 do you see:

// always add quantity regardless of whether or not it is in the listing for add to cart buttons
if (PRODUCT_LIST_QUANTITY < 1) {
  if (empty($select_column_list)) {
    $select_column_list .= ' p.products_quantity ';
  } else  {
    $select_column_list .= ', p.products_quantity ';
  }
}
17 Aug 2006, 12:18 AM
#7
sparktronic avatar

sparktronic

Zen Follower

Join Date:
Nov 2005
Location:
Rochester, New York
Posts:
153
Plugin Contributions:
0

Re: Search error in search box

I took the two files you suggested off another catalog that the search was working and now the search works fine. Thanks for your help and speed in getting back to me.

17 Aug 2006, 4:53 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search error in search box

Thanks for the update that you just had some files out of date ... :smile: