view mq.php @ 47:2a3943ced610

centralise db query even more
author Charlie Root
date Sun, 06 Jan 2019 12:17:05 -0500
parents
children a67bf725e87b
line wrap: on
line source

<?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);
  }
}
?>