More SQL rewrites, TODO: Put all table and column names in backticks (`)
[mailer.git] / inc / modules / guest / what-register.php
index 09716317831b7c4acc536ab184704458d0ca2046..e240aaaf07680cfa1f5019d7b0fdbdae148b3213 100644 (file)
@@ -72,7 +72,7 @@ if (empty($_POST['country_code'])) $_POST['country_code'] = "1";
 $_POST['refid'] = 0;
 if ($GLOBALS['refid'] > 0) {
        // Test if the refid is valid
-       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
                array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
 
        // Userid found?
@@ -156,7 +156,7 @@ if (isset($_POST['ok'])) {
        // Check for IP timeout?
        if ($_CONFIG['ip_timeout'] > 0) {
                // Check his IP number
-               $result = SQL_QUERY_ESC("SELECT joined, last_update FROM "._MYSQL_PREFIX."_user_data WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `"._MYSQL_PREFIX."_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
                        array(GET_REMOTE_ADDR(), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
@@ -229,7 +229,7 @@ if ((isset($_POST['ok'])) && ((!$FAILED) || (IS_ADMIN()))) {
        // Create user's account... //
        //////////////////////////////
        //
-       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_data (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.")
+       $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.")
 VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$ADD2.")",
        array(
                $countryRow,