returned function result is confused in conditional statement
<p>I have a class that works with database in PHP. the Add function in this class is:  </p>

<pre><code>    function Add($post_id)
    {
        if(!is_numeric($post_id))
        {
            return 1181;
        }

        $query  = "...";
        $result = mysql_query($query, $this-&gt;link);
        return $result;
    }
</code></pre>

<p>I also have a page that gets a form data and passes them to this class. The page code is:</p>

<pre><code>$result = $obj-&gt;Add($post_id);

if($result == 1181)
{
    echo 'invalid';
}
else if($result)
{
    echo 'success';
}
else
{
    echo 'error';
}
</code></pre>

<p>the returned value is 1 and the output must be 'success', but i get 'invalid' message. If i swap 'invalid' and 'success' conditional statements, everything works well, but i want to know that what's this problem for?  </p>
