heldenbrau Posted August 21, 2009 Share Posted August 21, 2009 In the database the field active is set to y It always dies with this code if ($row['active']!="y"){ die (header("location:forgotten.php?notactive=f")); But if I use this it doesn't if ($row['active']=="n"){ die (header("location:forgotten.php?notactive=f")); Shouldn't they both produce the same result? Quote Link to comment https://forums.phpfreaks.com/topic/171325-why-does-it-die/ Share on other sites More sharing options...
Flames Posted August 21, 2009 Share Posted August 21, 2009 they should if your only using y and n, but if you use h for example the first one would be true, second would be false. Quote Link to comment https://forums.phpfreaks.com/topic/171325-why-does-it-die/#findComment-903519 Share on other sites More sharing options...
Daniel0 Posted August 21, 2009 Share Posted August 21, 2009 You should use a tinyint and store 0 or 1 instead. When cast as boolean, these will represent false and true, respectively. Quote Link to comment https://forums.phpfreaks.com/topic/171325-why-does-it-die/#findComment-903523 Share on other sites More sharing options...
heldenbrau Posted August 21, 2009 Author Share Posted August 21, 2009 the values in the database are either y for yes they are registered n for no and s for suspended. If they have not activated their account, or their account is suspended, then I want the program to die. Quote Link to comment https://forums.phpfreaks.com/topic/171325-why-does-it-die/#findComment-903560 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.