# HG changeset patch # User Charlie Root # Date 1559939766 14400 # Node ID 5f772caee9a71781349e9c67a69575b066f4235f # Parent 72708ec9c0e690633a04f958806b7294a1ead913 try getting review from DB if throttled diff -r 72708ec9c0e6 -r 5f772caee9a7 xml/getAmazonInfo.php --- a/xml/getAmazonInfo.php Fri Jun 07 16:35:35 2019 -0400 +++ b/xml/getAmazonInfo.php Fri Jun 07 16:36:06 2019 -0400 @@ -341,7 +341,6 @@ if ( mysqli_num_rows( $res ) > 0 ) { $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); - mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop $output .= "" . $searchparameterdata . ""; $output .= "" . htmlspecialchars($rows["Title"]) . ""; $output .= "" . htmlspecialchars($rows["Author"]) . ""; @@ -355,10 +354,29 @@ $output .= "" . htmlspecialchars($rows["Genre2"]) . ""; $output .= "" . htmlspecialchars($rows["Genre3"]) . ""; $output .= "Book"; - $output .= "AccountLimitExceeded"; - + $query = "select Review1, Review2, Review3 from b_reviews where ID='$searchparameterdata'"; + mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop + include "db.php"; + $res = my_query($query,'gai4'); + if ( mysqli_num_rows( $res ) > 0 ) { + $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); + $output .= ""; + $output .= "" . htmlspecialchars($rows["Review1"]) . ""; + if (isset($rows["Review2"])) { + $output .= "" . htmlspecialchars($rows["Review2"]) . ""; + } + if (isset($rows["Review3"])) { + $output .= "" . htmlspecialchars($rows["Review3"]) . ""; + } + $output .= ""; + } + else { + $output .= "AccountLimitExceeded"; + } + mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop } else { + $output .= "AccountLimitExceeded"; mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop } $output .= "";