Skip to content

Commit

Permalink
Explicitly close database connection, rather than waiting for connect…
Browse files Browse the repository at this point in the history
…ion to time out
  • Loading branch information
pezholio committed Jun 22, 2012
1 parent 9f064a3 commit b378ecc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions distance.php
@@ -1,7 +1,7 @@
<?php
require_once("db.php");

mysql_connect('localhost', $db_username, $db_password);
$link = mysql_connect('localhost', $db_username, $db_password);
mysql_select_db($db_name) or die(mysql_error());

if ($_GET['postcode']) {
Expand Down Expand Up @@ -41,4 +41,5 @@
header ("content-type: text/html");
include("result.php");
}
?>

mysql_close($link);
4 changes: 2 additions & 2 deletions postcode.php
Expand Up @@ -5,7 +5,7 @@
require_once("json.php");
//require_once("electoraldistrict.php");

mysql_connect('localhost', $db_username, $db_password);
$link = mysql_connect('localhost', $db_username, $db_password);
mysql_select_db($db_name) or die(mysql_error());

if ($_GET['postcode']) {
Expand Down Expand Up @@ -176,4 +176,4 @@
header ("content-type: text/html");
include("result.php");
}

mysql_close($link);

0 comments on commit b378ecc

Please sign in to comment.