comparison php/read/getAllSavedBooks.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 077b0a0a3e6d
children a67bf725e87b
comparison
equal deleted inserted replaced
22:69c37b58d091 23:d606320ec331
30 $output .= "<results>"; 30 $output .= "<results>";
31 $output .= "<UserID>" . htmlspecialchars(trim($UserID)) . "</UserID>"; 31 $output .= "<UserID>" . htmlspecialchars(trim($UserID)) . "</UserID>";
32 32
33 $prevListName = ""; 33 $prevListName = "";
34 34
35 if ($results) {
35 while($line = mysqli_fetch_assoc($results)) { 36 while($line = mysqli_fetch_assoc($results)) {
36 37
37 $listName = htmlspecialchars(trim($line["SavedListName"])); 38 $listName = htmlspecialchars(trim($line["SavedListName"]));
38 39
39 if($listName != $prevListName) 40 if($listName != $prevListName)
56 $output .= "<SaveID>" . htmlspecialchars(trim($line["SaveID"])) . "</SaveID>"; 57 $output .= "<SaveID>" . htmlspecialchars(trim($line["SaveID"])) . "</SaveID>";
57 $output .= "</Book>"; 58 $output .= "</Book>";
58 59
59 $savedBooks++; 60 $savedBooks++;
60 } 61 }
61 62 $results->free();
62 if($savedBooks != 0) 63 }
63 { 64 mysqli_close($link);
64 $output .= "</ListDetails>"; 65 if($savedBooks != 0)
65 $output .= "</List>"; 66 {
66 } 67 $output .= "</ListDetails>";
68 $output .= "</List>";
69 }
67 $output .= "</results>"; 70 $output .= "</results>";
68 71
69 if(isset($ret)) 72 if(isset($ret))
70 return $output; 73 return $output;
71 else 74 else
72 echo $output; 75 echo $output;
73 76
74 mysqli_close($link); 77
75 78
76 79
77 ?> 80 ?>