Hello, i have this code bellow on my gaming site wich is a part of a cron query wich is supposed to give the top users of the day with the most points special features for the next day, i have now decided to do the same for people earning 2000 points each day, so i wonder the queary bellow, how would this code look like if i wanted it it to search the collumn "today_points" for users with 2000 points or above only? and give them the the same resault as "$update_user" and "$update_status" ? $sql = mysql_query("SELECT fid FROM fc_users ORDER BY today_points DESC LIMIT 1") or die (mysql_error()); $result = mysql_fetch_array($sql); $update_user = mysql_query("update fc_users set featured_profile = featured_profile + 2 where fid = " . $result["fid"] . " limit 1") or die (mysql_error()); $update_status = mysql_query("update fc_users set featured_status = 1 where fid = " . $result["fid"] . " limit 1") or die (mysql_error()); PHP:
mysql_query("update fc_users set featured_status = 1 where today_points > 2000") or die (mysql_error()); mysql_query("update fc_users set featured_status = 0 where today_points < 2000") or die (mysql_error()); PHP: The second one is to stop users who used to have more than 2000 points still getting featured status.
thanks! but how do you mean, with the second one, if they recived 2000 points they wont get it a second time ? if yes, they points reset every 24hours. is it possible to make the query set this status to users who have 2000 and up to 2500 points only?
mysql_query("update fc_users set featured_status = 1 where today_points BETWEEN 2000 AND 2500") or die (mysql_error()); mysql_query("update fc_users set featured_status = 0 where today_points < 2000") or die (mysql_error()); Code (markup):