diff us/index.php @ 23:d606320ec331

post-5.7-upgrade efforts to reduce dropped connections, db insertion fails
author Charlie Root
date Sun, 30 Dec 2018 07:00:09 -0500
parents 84a412b8122c
children b058736bc9ad
line wrap: on
line diff
--- a/us/index.php	Sun Dec 30 06:59:13 2018 -0500
+++ b/us/index.php	Sun Dec 30 07:00:09 2018 -0500
@@ -133,11 +133,13 @@
 				if ( mysqli_num_rows( $res ) > 0 )
 				{
 					$rows=mysqli_fetch_array($res, MYSQLI_ASSOC);		
+					mysqli_close($link);
 					$title = $rows["Title"];
 					$author = $rows["Author"];
 				}		
 				else
 				{
+				  mysqli_close($link);
 					$bookDetails = getAmazonDet($isbn,1,'us'); 
 					$bookXML = new SimpleXMLElement($bookDetails);
 					// HST added this
@@ -206,12 +208,13 @@
 				  if ( mysqli_num_rows( $res ) > 0 )
 				    {
 				      $rows=mysqli_fetch_array($res, MYSQLI_ASSOC);		
+				      mysqli_close($link);
 				      $titleL = $rows["Title"];
 				      $authorL = $rows["Author"];
-				      mysqli_close($link);
 				    }		
 				  else
 				    {					
+				      mysqli_close($link);
 				      $bookLDetails = getAmazonDet($linkedISBN,1,'us'); 
 				      $bookLXML = new SimpleXMLElement($bookLDetails);
 				      // HST added this