Changeset 45 for trunk/npemap.org.uk
- Timestamp:
- Oct 15, 2006, 4:44:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/cgi/get-postcodes.fcgi
r39 r45 66 66 if ($sth->execute($cgi->param('mineasting'), $cgi->param('maxeasting'), $cgi->param('minnorthing'), $cgi->param('maxnorthing'))) { 67 67 my $hr = $sth->fetchall_hashref('postcode'); 68 print "Content-type: text/x-json\n\n"; 69 print objToJson($hr) . "\n"; 68 print "Content-type: text/javascript\n\n"; 69 70 foreach my $key (keys %$hr) { 71 my $hash = $$hr{$key}; 72 print "addMarker('$$hash{postcode}', $$hash{easting}, $$hash{northing});\n"; 73 } 74 #print objToJson($hr) . "\n"; 70 75 } else { 71 76 print_err("Database error retrieving data"); … … 87 92 sub setup_dbh { 88 93 # $dbh is global 89 return $dbh = DBI->connect_cached("dbi:Pg:dbname=npemaps ","npemaps","");94 return $dbh = DBI->connect_cached("dbi:Pg:dbname=npemaps;host=127.0.0.1","npemaps","npemaps"); 90 95 }
Note: See TracChangeset
for help on using the changeset viewer.