X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Quick Syntax help request please (https://forum.x-cart.com/showthread.php?t=4866)

Scurvy 10-20-2003 09:25 PM

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?

funkydunk 10-23-2003 11:37 PM

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"));


All times are GMT -8. The time now is 09:34 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.