Why does my variable always seem to be 0?
<p>Here is my code:</p>

<pre><code>if (isset($_POST['addmonths'])){
    if (!empty($_POST['months'])){
        if (is_numeric($_POST['months'])){
            $monthtoadd = $_POST['months'];
            if ($monthstoadd == 0){
                mysql_query("UPDATE users SET months='lifetime' WHERE username='$lookupuser'");
                echo "Successfully set " . $lookupuser . " to lifetime" . $monthstoadd;
            }elseif ($monthstoadd &gt; 0){
                $monthstoadd = $monthstoadd*2592000;
                mysql_query("UPDATE users SET months=months+'$monthstoadd' WHERE username='$lookupuser'");
                echo "Successfully added " . $monthstoadd . " months to " . $lookupuser . "'s paid time.";
            }else{
                echo "Error.";
            }
        }else{
            echo "Months need to be numeric. If you're trying to set lifetime, use 0.";
        }
    }else{
        echo "You didn't enter anything.";
    }
}
</code></pre>

<p>No matter what number I enter, it always seems to set it to lifetime, and then it doesn't echo the <code>$monthstoadd</code> after it, which is just there to help me see why it's not working. I can't figure this out for the life of me. If I don't enter anything, it echos <code>You didn't enter anything.</code> like its supposed to, and if its not a number, it echos <code>Months need to be numeric. If you're trying to set lifetime, use 0.</code> like its supposed to.</p>

<p>Anyone have any ideas?</p>
