Topic: Wrong logic for City, State

Suppose you've got these 4 listings
1) Springfield, Vermont
2) Springfield, Vermont
3) Springfield, Michigan
4) Springfield, Ohio

When you do a "home search" the menu page will show 4 properties from Springfield, Vermont (none from Springfield, Michigan and none from Springfield, Ohio), which is wrong. If you select the properties from Springfield, Vermont, the program will (correctly) show you only the 2 properties from Springfield, Vermont.

I think the fix is fairly simple and I think I fixed that myself way back in one of John Roig's files.

Cheers,
Paul.

Re: Wrong logic for City, State

Yep, you're absolutely right. This was fixed once upon a time, not sure what happened to it... I will track down the fix and reapply it.

Patrick
Lead developer FreeRealty
Other claims to fame: http://www.rwcinc.net
Enrolled Agent, Licensed to Represent Taxpayers before Exams, Appeals and Conference divisions of the Internal Revenue Service.

Re: Wrong logic for City, State

Change line 37 from:

 $result = mysql_query("SELECT ".$table_prefix."homes.city, state, count(*) AS
 num_town FROM ".$table_prefix."homes WHERE status != 'Held' 
GROUP BY city ORDER BY state, city;",$link);

to:

  $result = mysql_query("SELECT ".$table_prefix."homes.city, state, count(*) AS 
num_town FROM ".$table_prefix."homes WHERE status != 'Held' 
GROUP BY city, state ORDER BY state, city;",$link);

adding "state" to the GROUP BY clause.

Patrick
Lead developer FreeRealty
Other claims to fame: http://www.rwcinc.net
Enrolled Agent, Licensed to Represent Taxpayers before Exams, Appeals and Conference divisions of the Internal Revenue Service.