Mercurial > hg > ywww
comparison mq.php @ 54:a04fc91bbd95
avoid warning on boolean
| author | Charlie Root |
|---|---|
| date | Fri, 07 Jun 2019 16:35:16 -0400 |
| parents | dd93cb4b77ad |
| children |
comparison
equal
deleted
inserted
replaced
| 53:dd93cb4b77ad | 54:a04fc91bbd95 |
|---|---|
| 2 function my_query($q,$d='x') | 2 function my_query($q,$d='x') |
| 3 { | 3 { |
| 4 global $link; | 4 global $link; |
| 5 $res = mysqli_query($link, $q); | 5 $res = mysqli_query($link, $q); |
| 6 include_once "dlog.php"; | 6 include_once "dlog.php"; |
| 7 dl("query from $d: ".mysqli_num_rows( $res )." $q\n"); | 7 dl("query from $d: ".is_bool($res) ? $res : mysqli_num_rows( $res )." $q\n"); |
| 8 if ($res) { | 8 if ($res) { |
| 9 return $res; | 9 return $res; |
| 10 } | 10 } |
| 11 else { | 11 else { |
| 12 $err=mysqli_error( $link ); | 12 $err=mysqli_error( $link ); |
