diff --git a/ChangeLog b/ChangeLog index b5e4ac4..217bb8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-07 Vincent Untz + + * foundation.gnome.org/vote/include/election-sql.php: + (elec_get_blank_votes_election): I think I have the correct query now. + 2005-11-07 Vincent Untz * foundation.gnome.org/vote/include/election-sql.php: diff --git a/foundation.gnome.org/vote/include/election-sql.php b/foundation.gnome.org/vote/include/election-sql.php index 8b27c44..6c02338 100644 --- a/foundation.gnome.org/vote/include/election-sql.php +++ b/foundation.gnome.org/vote/include/election-sql.php @@ -392,11 +392,10 @@ function elec_get_blank_votes_election ($handle, $election_id) { $query = "SELECT COUNT(att.id) AS total_blank FROM " . $anon_tokens_table . " AS att, " . $votes_table . " AS vt"; $query .= " WHERE att.election_id = '".$escaped_election_id."'"; - /* - $query .= " AND (att.id != vt.anon_id"; - $query .= " OR (vt.choice_id = '-1' AND att.id = vt.anon_id))"; - */ - $query .= " AND (vt.choice_id = '-1' AND att.id = vt.anon_id)"; + $query .= " AND (NOT EXISTS ("; + $query .= " SELECT anon_id FROM " . $anon_tokens_table . " AS att, " . $votes_table . " AS vt"; + $query .= " WHERE att.id = vt.anon_id"; + $query .= " ) OR (vt.choice_id = '-1' AND att.id = vt.anon_id))"; $result = mysql_query ($query, $handle);