View Single Post
  #2  
Old 08-14-2007, 07:06 PM
 
dub713 dub713 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 56
 

Default Re: random.php/random product listing modification needed...

bumping this since i can't get the syntax right on my own...


so, for this chunk in the PHP....


Code:
<? // the database query $query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid ORDER BY RAND() LIMIT 4 "; // give the product array to smarty to make it available sitewide. $randoms = func_query($query); $smarty->assign("randoms",$randoms); ?>


how can i exclude one cat, and all subcats.

for example. the main category id is 274

wouldn't it be close to....

AND $sql_tbl[categories].categoryid ne "274"

or something close that? what's another way to specify "not equal to" instead of the ne?

thanks,
j
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2
Reply With Quote