changeset 47:2a3943ced610

centralise db query even more
author Charlie Root
date Sun, 06 Jan 2019 12:17:05 -0500
parents b7376319d25a
children da133c130c1d
files mq.php
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mq.php	Sun Jan 06 12:17:05 2019 -0500
@@ -0,0 +1,17 @@
+<?php
+function my_query($q,$d='x')
+{
+  global $link;
+  $res = mysqli_query($link, $q);
+  if ($res) {
+    return $res;
+  }
+  else {
+    $err=mysqli_error( $link );
+    mysqli_close($link);
+    include_once "ywww/dlog.php";
+    dl("query from $d failed: $q\n$err\n");
+    exit($err);
+  }
+}
+?>
\ No newline at end of file