scud Posted February 20, 2004 Posted February 20, 2004 Although I have managed to change the sorting attribute of the product listing when the appropriate category is selected, the asc or desc order seems to not be functioning properly. What I need is sorting by manufacturer in descending order... and here is the code if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_MANUFACTURER') { $HTTP_GET_VARS['sort'] = $i+1 . 'd'; $listing_sql .= " order by m.manufacturers_name"; break; } } } else { Here is the site
♥yesudo Posted February 20, 2004 Posted February 20, 2004 not sure really but could try: if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { ? ? for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { ? ? ? if ($column_list[$i] == 'PRODUCT_LIST_MANUFACTURER') { ? ? ? ? $HTTP_GET_VARS['sort'] = $i+1 . 'd'; ? ? ? ? $listing_sql .= " order by m.manufacturers_name desc"; ? ? ? ? break; ? ? ? } ? ? } ? } else { line amended: $listing_sql .= " order by m.manufacturers_name desc"; Your online success is Paramount.
scud Posted February 20, 2004 Author Posted February 20, 2004 yep... that seems to do the trick! thanx!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.