From 07fa2cb1238bb75dbf0414a26bdff57cd5966d4a Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Thu, 27 Oct 2016 13:45:24 -0400 Subject: [PATCH] Add code to both ch11 projects to close databases --- chapter11/project1/display-customers.php | 13 ++++++++++- chapter11/project2/browse-images.php | 28 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/chapter11/project1/display-customers.php b/chapter11/project1/display-customers.php index cb477f5..a71da32 100644 --- a/chapter11/project1/display-customers.php +++ b/chapter11/project1/display-customers.php @@ -149,7 +149,18 @@ - +<?php + # Close database connections. + if ($sqlCustomers) { + $sqlCustomers = null; + } + if ($sqlImprints) { + $sqlImprints = null; + } + if ($sqlCategories) { + $sqlCategories = null; + } +?> <!-- Bootstrap core JavaScript diff --git a/chapter11/project2/browse-images.php b/chapter11/project2/browse-images.php index 5c7f96d..b38202f 100644 --- a/chapter11/project2/browse-images.php +++ b/chapter11/project2/browse-images.php @@ -204,6 +204,34 @@ +<?php + # Close database connections. + if ($sqlGeoContinents) { + $sqlGeoContinents = null; + } + if ($sqlGeoCountries) { + $sqlGeoCountries = null; + } + if ($sqlGeoCities) { + $sqlGeoCities = null; + } + if ($sqlTravelImage) { + $sqlGeoContinents = null; + } + if ($sqlTravelImageDetails) { + $sqlGeoContinents = null; + } + if ($sqlCountriesMatch) { + $sqlCountriesMatch = null; + } + if ($sqlCountriesMatch2) { + $sqlCountriesMatch2 = null; + } + if ($sqlFilterMatch) { + $sqlFilterMatch = null; + } +?> + <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> -- GitLab