if statement not working with database
<p>Why isn't this code working?</p>

<pre><code>$welcome = mysql_query("SELECT welcome FROM users WHERE id = '" . $_SESSION['user']['id'] . "'");

if($welcome == '0')
{
echo 'register is 0';
}
else
{
echo 'register is 1';
}
</code></pre>

<p><code>$_SESSION['user']['id']</code> returns as 1, by the way.</p>
