View Single Post
  #2  
Old 10-23-2003, 11:37 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default Re: Quick Syntax help request please

Quote:
Originally Posted by Scurvy
Take a look at this code from the categories.php file.

$categories_data = func_query("select $sql_tbl[categories].*, 0 as product_count from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' AND '$kit' like $sql_tbl[categories].category $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category"));

The only thing I added is: AND '$kit' like $sql_tbl[categories].category

It works just fine as it is, but what I really need is to have the % wildcard before and after the $sql_tbl[categories].category so I can have fuzzy matches. I've tried everything I can think of to get them in there using tics, quotes, parentheses, slashes, etc but I always get a syntax error. Can anyone lend a hand here?

Code:
$categories_data = func_query("select $sql_tbl[categories].*, 0 as product_count from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' AND $sql_tbl[categories].category LIKE '%$kit%' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category"));
__________________
ex x-cart guru
Reply With Quote