Mercurial > hg > ywww
annotate mq.php @ 56:5f772caee9a7
try getting review from DB if throttled
author | Charlie Root |
---|---|
date | Fri, 07 Jun 2019 16:36:06 -0400 |
parents | a04fc91bbd95 |
children |
rev | line source |
---|---|
47 | 1 <?php |
2 function my_query($q,$d='x') | |
3 { | |
4 global $link; | |
5 $res = mysqli_query($link, $q); | |
53
dd93cb4b77ad
more debugging (too much for production), fallback to DB if getBookDetails is knocked back by Amazon
Charlie Root
parents:
49
diff
changeset
|
6 include_once "dlog.php"; |
54 | 7 dl("query from $d: ".is_bool($res) ? $res : mysqli_num_rows( $res )." $q\n"); |
47 | 8 if ($res) { |
9 return $res; | |
10 } | |
11 else { | |
12 $err=mysqli_error( $link ); | |
13 mysqli_close($link); | |
49
a67bf725e87b
put both paths in include_path and depend on that
Charlie Root
parents:
47
diff
changeset
|
14 include_once "dlog.php"; |
47 | 15 dl("query from $d failed: $q\n$err\n"); |
16 exit($err); | |
17 } | |
18 } | |
19 ?> |