I'm working on a listing site which is mainly organised by zip code distances. My only problem is when the listing are shown they're scattered according to the database.
I cant use GROUP BY city because this will only show 1 for each city, I cant use ORDER BY because this orders the RESULTS of the cities. I need to find out how to order the cities either in order they were requested or before the search starts.
example:
$query = "SELECT * FROM listings WHERE goodtogo='y' AND city='Cranford' OR city='Clark' OR city='Elizabeth'";
so if there are 3 listings in each city but scattered in the database they would be listed in this order:
Cranford,Cranford,Cranford,
Clark,Clark,Clark,
Elizabeth,Elizabeth,Elizabeth
Because GROUP will show:
Cranford,Clark,Elizabeth
And ORDER will show:
Clark,Clark,Clark,
Cranford,Cranford,Cranford,
Elizabeth,Elizabeth,Elizabeth
ANY ideas?