# HG changeset patch
# User Charlie Root
# Date 1560077444 14400
# Node ID 05f29eb7228323a27594ab5c2468aa58c2aba2be
# Parent e4c78b3eace76fc6e3a145bc3f23d2314c0a6001
review from DB not working???
diff -r e4c78b3eace7 -r 05f29eb72283 xml/getAmazonInfo.php
--- a/xml/getAmazonInfo.php Sun Jun 09 06:49:35 2019 -0400
+++ b/xml/getAmazonInfo.php Sun Jun 09 06:50:44 2019 -0400
@@ -49,6 +49,7 @@
$show_array,$show_url,$show_xml);
}
catch (Exception $e) {
+ dl("gai: falling back to local\n");
return getAmazonDetLocal($go,$language,$loc,
$page,$operation,$searchparameter,
$searchparameterdata,
@@ -84,7 +85,7 @@
//'SearchIndex' =>$searchindex , //Books for example.
$parameters['SearchIndex']=$searchindex;
}
- $xml=doAmazonRequest($Aserver[$locale]['ext'],$parameters,3,'i'); // may throw exception
+ $xml=doAmazonRequest($Aserver[$locale]['ext'],$parameters,2,'i'); // may throw exception
set_error_handler(function () {
global $output;
dl("Caught one?: $searchparameterdata\n");
@@ -333,6 +334,7 @@
include "db.php";
$query = "CALL b_getBookInfo('$searchparameterdata', $loc)";
//echo $query;
+ dl("gai: querying $query\n");
$res = my_query($query,'gai3');
$output = "";
@@ -354,6 +356,7 @@
$output .= "" . htmlspecialchars($rows["Genre2"]) . "";
$output .= "" . htmlspecialchars($rows["Genre3"]) . "";
$output .= "Book";
+ if (false) {
$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";
@@ -361,18 +364,22 @@
if ( mysqli_num_rows( $res ) > 0 ) {
$rows=mysqli_fetch_array($res, MYSQLI_ASSOC);
$output .= "";
- $output .= "" . htmlspecialchars($rows["Review1"]) . "";
+ $output .= "" . htmlspecialchars($rows["Review1"]) . "";
if (isset($rows["Review2"])) {
- $output .= "" . htmlspecialchars($rows["Review2"]) . "";
+ $output .= "" . htmlspecialchars($rows["Review2"]) . "";
}
if (isset($rows["Review3"])) {
- $output .= "" . htmlspecialchars($rows["Review3"]) . "";
+ $output .= "" . htmlspecialchars($rows["Review3"]) . "";
}
$output .= "";
}
else {
$output .= "AccountLimitExceeded";
}
+ }
+ else {
+ $output .= "AccountLimitExceeded";
+ }
mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop
}
else {