I am trying to query a database for values and then redirect to a different page if the values show up or otherwise do nothing.
mysql_query("SELECT questionone FROM test WHERE id = $session[id]");
if ( questionone == '1' || '0' )
{
header("Location: <!-- m --><a class="postlink" href="http://www.newpage.net/moduleone/answererror.php">http://www.newpage.net/moduleone/answererror.php</a><!-- m -->? );
}
The problem is this code will redirect to the new page if the database column (questionone) is empty, has a 1 or 0 in it. I don't understand why it is redirecting to the new page if there is not a 1 or 0 in the column. Is there a better way to accomplish this kind of redirection. And is it possible to query a database and redirect if there is nothing in the column? Seems simple enough but I can't get this scheme to work.
Thanks.
mysql_query("SELECT questionone FROM test WHERE id = $session[id]");
if ( questionone == '1' || '0' )
{
header("Location: <!-- m --><a class="postlink" href="http://www.newpage.net/moduleone/answererror.php">http://www.newpage.net/moduleone/answererror.php</a><!-- m -->? );
}
The problem is this code will redirect to the new page if the database column (questionone) is empty, has a 1 or 0 in it. I don't understand why it is redirecting to the new page if there is not a 1 or 0 in the column. Is there a better way to accomplish this kind of redirection. And is it possible to query a database and redirect if there is nothing in the column? Seems simple enough but I can't get this scheme to work.
Thanks.