Mercurial > hg > ywww
comparison 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 |
comparison
equal
deleted
inserted
replaced
22:69c37b58d091 | 23:d606320ec331 |
---|---|
131 include "../xml/aws_signed_request.php"; | 131 include "../xml/aws_signed_request.php"; |
132 include "../xml/getAmazonInfo.php"; | 132 include "../xml/getAmazonInfo.php"; |
133 if ( mysqli_num_rows( $res ) > 0 ) | 133 if ( mysqli_num_rows( $res ) > 0 ) |
134 { | 134 { |
135 $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); | 135 $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); |
136 mysqli_close($link); | |
136 $title = $rows["Title"]; | 137 $title = $rows["Title"]; |
137 $author = $rows["Author"]; | 138 $author = $rows["Author"]; |
138 } | 139 } |
139 else | 140 else |
140 { | 141 { |
142 mysqli_close($link); | |
141 $bookDetails = getAmazonDet($isbn,1,'us'); | 143 $bookDetails = getAmazonDet($isbn,1,'us'); |
142 $bookXML = new SimpleXMLElement($bookDetails); | 144 $bookXML = new SimpleXMLElement($bookDetails); |
143 // HST added this | 145 // HST added this |
144 if (preg_match("<Error>",$bookDetails)) { | 146 if (preg_match("<Error>",$bookDetails)) { |
145 $resName=$bookXML->getName(); | 147 $resName=$bookXML->getName(); |
204 // FILE_APPEND); | 206 // FILE_APPEND); |
205 } ); | 207 } ); |
206 if ( mysqli_num_rows( $res ) > 0 ) | 208 if ( mysqli_num_rows( $res ) > 0 ) |
207 { | 209 { |
208 $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); | 210 $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); |
211 mysqli_close($link); | |
209 $titleL = $rows["Title"]; | 212 $titleL = $rows["Title"]; |
210 $authorL = $rows["Author"]; | 213 $authorL = $rows["Author"]; |
211 mysqli_close($link); | |
212 } | 214 } |
213 else | 215 else |
214 { | 216 { |
217 mysqli_close($link); | |
215 $bookLDetails = getAmazonDet($linkedISBN,1,'us'); | 218 $bookLDetails = getAmazonDet($linkedISBN,1,'us'); |
216 $bookLXML = new SimpleXMLElement($bookLDetails); | 219 $bookLXML = new SimpleXMLElement($bookLDetails); |
217 // HST added this | 220 // HST added this |
218 if (preg_match("<Error>",$bookLDetails)) { | 221 if (preg_match("<Error>",$bookLDetails)) { |
219 $resName=$bookLXML->getName(); | 222 $resName=$bookLXML->getName(); |