Mercurial > hg > ywww
comparison mq.php @ 47:2a3943ced610
centralise db query even more
| author | Charlie Root |
|---|---|
| date | Sun, 06 Jan 2019 12:17:05 -0500 |
| parents | |
| children | a67bf725e87b |
comparison
equal
deleted
inserted
replaced
| 46:b7376319d25a | 47:2a3943ced610 |
|---|---|
| 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 ?> |
