Ok here is the code. `
mysql_query("UPDATE `special` SET `Counter` = `Counter` - 1");
$Counter = mysql_query("SELECT Counter FROM special where Id = 1");
if($Counter == 0)
{
echo "<meta http-equiv=\"refresh\" content=\"0;URL=winner.php\">";
mysql_query("UPDATE `special` SET `Counter` = `Counter` + 500");
}
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
}
?>
im attempting to create a counter that starts at 500 and every visit it counts down by 1 till it hits 0 when it does it should go to the winner.php page and reset the counter to 500.
What is happening is it hits zero and never goes to winner.php or resets the counter. where am I messing up? It goes to the index page just fine. although i guess i have extra code to go to the index page. this coding will be called from the index so can i have a else do nothing? such as else {}.