Mercurial > hg > ywww
annotate mq.php @ 47:2a3943ced610
centralise db query even more
author | Charlie Root |
---|---|
date | Sun, 06 Jan 2019 12:17:05 -0500 |
parents | |
children | a67bf725e87b |
rev | line source |
---|---|
47 | 1 <?php |
2 function my_query($q,$d='x') | |
3 { | |
4 global $link; | |
5 $res = mysqli_query($link, $q); | |
6 if ($res) { | |
7 return $res; | |
8 } | |
9 else { | |
10 $err=mysqli_error( $link ); | |
11 mysqli_close($link); | |
12 include_once "ywww/dlog.php"; | |
13 dl("query from $d failed: $q\n$err\n"); | |
14 exit($err); | |
15 } | |
16 } | |
17 ?> |