diff --git a/chapter11/project1/display-customers.php b/chapter11/project1/display-customers.php
index cb477f51cc9c004b98a14a728c6f39722c39858b..a71da32f4886446da38f28c3602b84f52b081898 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 5c7f96d904edaacfebe3657d55d30985e2ceba25..b38202f38f6fe16e7b031781f97da4bbd30ed8f3 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 -->