View Single Post
  #18  
Old 10-29-2003, 10:20 AM
 
lixy lixy is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 41
 

Default

I have tried this enhaced search function with 3.4.5 and it works perfectly except for one thing...blank searches. If the search criteria is left blank and a search is executed a the search results returns "no matching products found" and an SQL error:

Code:
INVALID SQL: 1064 : You have an error in your SQL syntax near '1 group by xcart_products.productid' at line 2 SQL QUERY FAILURE: select count(*) from xcart_products, xcart_pricing, xcart_categories where xcart_pricing.productid=xcart_products.productid and xcart_pricing.quantity=1 and xcart_products.categoryid=xcart_categories.categoryid AND (xcart_categories.membership='' OR xcart_categories.membership='') and (xcart_pricing.membership='' or xcart_pricing.membership='') AND (xcart_products.categoryid in ( '1', '4', '14', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '67', '106') or xcart_products.categoryid1 in ( '1', '4', '14', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '67', '106') or xcart_products.categoryid2 in ( '1', '4', '14', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '67', '106') or xcart_products.categoryid3 in ( '1', '4', '14', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '67', '106')) and xcart_products.forsale='Y' and xcart_categories.avail='Y' 1 group by xcart_products.productid

I want this enhanced search function to return every product in the DB on the result page if the search criteria is left blank and a search is executed. Another interesting thing is that if you enter a <SPACE> in the search criteria and execute a search the function will return every product in the DB as it should. Any help would be great.
Reply With Quote