From adf62b2a7b5a6acc7c686686e4e5e9387a12a547 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 25 Oct 2005 22:05:51 +0000 Subject: [PATCH] fix code so that it works in MySQL 4.1 (but won't work in MySQL 4.0...) 2005-10-25 Vincent Untz * foundation.gnome.org/vote/include/election-sql.php: fix code so that it works in MySQL 4.1 (but won't work in MySQL 4.0...) --- ChangeLog | 5 +++++ foundation.gnome.org/vote/include/election-sql.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b23098b..82753e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-25 Vincent Untz + + * foundation.gnome.org/vote/include/election-sql.php: fix code so that + it works in MySQL 4.1 (but won't work in MySQL 4.0...) + 2005-10-25 Vincent Untz * foundation.gnome.org/referenda/2005-10/rules.wml: updated the diff --git a/foundation.gnome.org/vote/include/election-sql.php b/foundation.gnome.org/vote/include/election-sql.php index cfc3406..73d46c7 100644 --- a/foundation.gnome.org/vote/include/election-sql.php +++ b/foundation.gnome.org/vote/include/election-sql.php @@ -304,7 +304,8 @@ function elec_sql_remove_tmp_token ($handle, $election_id, $email, $tmp_token) { $escaped_email = mysql_real_escape_string ($email, $handle); $escaped_tmp_token = mysql_real_escape_string ($tmp_token, $handle); - $query = "DELETE FROM " . $tmp_tokens_table; + /* In MySQL < 4.1, you'd do "DELETE FROM " . $tmp_tokens_table */ + $query = "DELETE FROM tt"; $query .= " USING ". $tmp_tokens_table . " AS tt, " . $members_table . " AS mt"; $query .= " WHERE tt.election_id = '".$escaped_election_id."'"; $query .= " AND tt.tmp_token = '".$escaped_tmp_token."'";