View Full Version : Sort order
November 28th, 2010, 10:17 PM
When I go in my classifieds and choose ZipCode for the sort order, it's all out of wack:
Ford Rangers For Sale - TRS Classifieds (http://www.therangerstation.com/Classifieds/showcat.php?cat=3&page=1)
The ads aren't showing up in relation to their zip codes.
November 28th, 2010, 11:41 PM
its ordering by zipcode of the actual ads which has nothing to do with distance or anything so not sure what you mean by out of whack as I think you must think it means distance not the actual numerical zipcode.
November 29th, 2010, 11:00 AM
I figured it would sort by distance from the users zip code (like other classifieds). I really don't know why anyone would want to organize ads just by numerical zip code.
November 29th, 2010, 11:11 AM
well it is not really possible to sort results on a mysql field that does not exist. Sorting is done on a field in the products table like title,extra fields,rating etc. Results are sorted when returned by the query. Its basically in mysql and order statement like
ORDER BY title DESC
Distance calculations for zipcode are done after the sorted results are returned.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.