From fac2d9a880a1e10a613bbbc7bddd7e461c5d9dbf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Sep 2016 13:49:55 -0400 Subject: [PATCH] Fix registration request notification query - Removed wrong usage of COUNT in registration request query - Added simple count() of results --- mod/ping.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/ping.php b/mod/ping.php index 8c28e74744..da44bc52df 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -123,9 +123,8 @@ function ping_init(&$a) { $mail = count($mails); if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ - $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); - if ($regs) - $register = $regs[0]['total']; + $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); + $register = count($regs); } else { $register = "0"; }