From e6000f3f6e5832ba0843167e95457451453d9bdc Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 3 Jan 2013 02:10:37 -0800 Subject: fix event query - some DB's have problems with it --- mod/ping.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod/ping.php') diff --git a/mod/ping.php b/mod/ping.php index b135ac6e3..6b76c33ca 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -210,7 +210,7 @@ function ping_init(&$a) { $t5 = dba_timer(); - $events = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event` + $events = q("SELECT type, start, adjust FROM `event` WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and `ignore` = 0 ORDER BY `start` ASC ", intval(local_user()), @@ -218,8 +218,8 @@ function ping_init(&$a) { dbesc(datetime_convert('UTC','UTC','now')) ); - if($events && count($events)) { - $result['all_events'] = intval($events[0]['total']); + if($events) { + $result['all_events'] = count($events); if($result['all_events']) { $str_now = datetime_convert('UTC',$a->timezone,'now','Y-m-d'); -- cgit v1.2.3