From 5e8877ed2492858e5f988a0bc3033207e5460d09 Mon Sep 17 00:00:00 2001 From: x2000chevalier Date: Sun, 31 Oct 2004 17:58:32 +0000 Subject: [PATCH] SQL query bug fix --- htdocs/marketing/index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/marketing/index.php b/htdocs/marketing/index.php index eb9818c..d5c079a 100644 --- a/htdocs/marketing/index.php +++ b/htdocs/marketing/index.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: index.php,v 1.3 2004-10-31 16:39:06 x2000chevalier Exp $ + $Id: index.php,v 1.4 2004-10-31 17:58:32 x2000chevalier Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -27,15 +27,15 @@ new_admin_page('marketing/index.tpl'); # Quelques statistiques $sql = "SELECT count(*) as vivants, - count(user!='non-inscrit') as inscrits, - 100*count(user!='non-inscrit')/count(*) as ins_rate, + count(NULLIF(perms!='non-inscrit', 0)) as inscrits, + 100*count(NULLIF(perms!='non-inscrit', 0))/count(*) as ins_rate, count(NULLIF(promo >= 1972, 0)) as vivants72, - count(NULLIF(promo >= 1972 AND user!='non-inscrit', 0)) as inscrits72, - 100 * count(NULLIF(promo >= 1972 AND user!='non-inscrit', 0)) / + count(NULLIF(promo >= 1972 AND perms!='non-inscrit', 0)) as inscrits72, + 100 * count(NULLIF(promo >= 1972 AND perms!='non-inscrit', 0)) / count(NULLIF(promo >= 1972, 0)) as ins72_rate, count(NULLIF(FIND_IN_SET('femme', flags), 0)) as vivantes, - count(NULLIF(FIND_IN_SET('femme', flags) AND user!='non-inscrit', 0)) as inscrites, - 100 * count(NULLIF(FIND_IN_SET('femme', flags) AND user!='non-inscrit', 0)) / + count(NULLIF(FIND_IN_SET('femme', flags) AND perms!='non-inscrit', 0)) as inscrites, + 100 * count(NULLIF(FIND_IN_SET('femme', flags) AND perms!='non-inscrit', 0)) / count(NULLIF(FIND_IN_SET('femme', flags), 0)) as inse_rate FROM auth_user_md5 WHERE deces = 0"; -- 2.1.4