I have a table in mysql which all it does is hold a value, a counter, every time someone visits my website, it adds value = value + 1.
Every 51 visitors should see a popup saying that they win something:
$sql = "SELECT * from code_win_count LIMIT 1";
$rs = $custom_conn->execute($sql);
$count = $rs->fields['code_wins'];
So if 50 people visit the website, visitor number 51 should get a popup saying that they can redeem a coupon... if 100 people visit the website, number 101 will also get a popup saying that they win something and so on and so on...