Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Quick Syntax help request please

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-20-2003, 09:25 PM
 
Scurvy Scurvy is offline
 

Member
  
Join Date: Apr 2003
Posts: 15
 

Default Quick Syntax help request please

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?
Reply With Quote
  #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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:39 AM.

   

 
X-Cart forums © 2001-2020