Changeset 259


Ignore:
Timestamp:
Oct 31, 2006, 6:02:16 PM (13 years ago)
Author:
Nick Burch
Message:

A postcode isn't always unique, so we can't use hash fetch methods, otherwise we'll only see one instance of a postcode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/cgi/get-postcodes.fcgi

    r238 r259  
    7272   
    7373    if ($sth->execute($cgi->param('mineasting'), $cgi->param('maxeasting'), $cgi->param('minnorthing'), $cgi->param('maxnorthing'))) {
    74         my $hr = $sth->fetchall_hashref('postcode');
    7574        print "Content-type: text/javascript\n\n";
    7675
    77         foreach my $key (keys %$hr) {
    78             my $hash = $$hr{$key};
    79             print "addMarker('$$hash{postcode}', $$hash{easting}, $$hash{northing}, [$$hash{id}, $$hash{source}]);\n";
     76        while(my @row = $sth->fetchrow_array) {
     77                        my ($postcode,$easting,$northing,$id,$source) = @row;
     78            print "addMarker('$postcode', $easting, $northing, [$id, $source]);\n";
    8079        }
    8180        print "completeMarkers();\n";
Note: See TracChangeset for help on using the changeset viewer.