view mq.php @ 53:dd93cb4b77ad

more debugging (too much for production), fallback to DB if getBookDetails is knocked back by Amazon
author Charlie Root
date Thu, 06 Jun 2019 16:37:20 -0400
parents a67bf725e87b
children a04fc91bbd95
line wrap: on
line source

<?php
function my_query($q,$d='x')
{
  global $link;
  $res = mysqli_query($link, $q);
  include_once "dlog.php";
  dl("query from $d: ".mysqli_num_rows( $res )." $q\n");
  if ($res) {
    return $res;
  }
  else {
    $err=mysqli_error( $link );
    mysqli_close($link);
    include_once "dlog.php";
    dl("query from $d failed: $q\n$err\n");
    exit($err);
  }
}
?>