Changeset 61


Ignore:
Timestamp:
Oct 16, 2006, 2:37:35 PM (13 years ago)
Author:
David Sheldon
Message:

Use BETWEEN rather than >= and <= in SELECT

File:
1 edited

Legend:

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

    r47 r61  
    7070    }
    7171
    72     my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing FROM postcodes WHERE easting >= ? AND easting <= ? AND northing >= ? AND northing <= ?");
     72    my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing FROM postcodes WHERE easting BETWEEN ? AND ? AND northing BETWEEN ? AND ?");
    7373    if ($sth->execute($cgi->param('mineasting'), $cgi->param('maxeasting'), $cgi->param('minnorthing'), $cgi->param('maxnorthing'))) {
    7474        my $hr = $sth->fetchall_hashref('postcode');
Note: See TracChangeset for help on using the changeset viewer.