define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "409");
+define('CURR_SVN_REVISION', "410");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
for ($rank = 1; $rank <= $max; $rank++)
{
// Load data
- $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND level=%s LIMIT 1",
+ $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND level='%s' LIMIT 1",
array($type, $data, $rank), __FILE__, __LINE__);
list($userid, $points, $mark) = SQL_FETCHROW($result_users);
$id = bigintval($id);
// Update entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level=%s, percents='%s' WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__);
}
$TEXT = REF_DEPTHS_SAVED;
{
if (strpos($SQL[0], "INSERT") > -1)
{
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
SQL_FREERESULT($result);
}
if ((!empty($_POST['level'])) && ((!empty($_POST['points'])) || (!empty($_POST['info']))))
{
// Submitted data is valid, but maybe we already have this price level?
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s AND price_level=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s AND price_level='%s' LIMIT 1",
array(bigintval($_GET['rallye']), bigintval($_POST['level'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0)
$id = bigintval($id);
// Update entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_prices SET rallye_id=%s, price_level=%s, points='%s', info='%s' WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_prices SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE id=%s LIMIT 1",
array($_POST['rallye_id'][$id], bigintval($level), $_POST['points'][$id], $_POST['infos'][$id], $id), __FILE__, __LINE__);
}
}
// Load referral counts
- $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level=%s LIMIT 1",
+ $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level='%s' LIMIT 1",
array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_refs) == 1) {
list($REFS) = SQL_FETCHROW($result_refs);
}
} else {
// Get referal data
- $result_lvl = SQL_QUERY_ESC("SELECT percents FROM "._MYSQL_PREFIX."_refdepths WHERE level=%s LIMIT 1",
+ $result_lvl = SQL_QUERY_ESC("SELECT percents FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
array(bigintval($level)), __FILE__, __LINE__);
// Entry found?
//* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
// Update counter
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
// When no entry was updated then we have to create it here
} // END - if
// Check existence
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level=%s AND refid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
// Do we have no entry?
$uid = $old;
// Shall we add this as well?
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level=%s AND refid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
// Do we have no entry?