FusionTech Posted April 14, 2013 Share Posted April 14, 2013 I know, its probably a really basic question for most of you out there, but I can't seem to find an answer. This is what I've tried: if(SELECT * FROM users WHERE usertype='a';) { print "You are a regular user!"; } else { print "You are an administrative user!"; } It always says You are an administrative user! when I log in, even though I am user type a in the database. Also, if anyone could tell me how to generate a user profile page (http://domain.com/profile.php?fusiontech) after a user registers, that would be great also. Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/ Share on other sites More sharing options...
requinix Posted April 14, 2013 Share Posted April 14, 2013 How about posting your actual code. And the whole thing - especially the part that logs you in. Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/#findComment-1424746 Share on other sites More sharing options...
FusionTech Posted April 14, 2013 Author Share Posted April 14, 2013 (edited) Ok, this is everything in the file that that code came from. EDIT: Sorry, that last link was bad. http://pastebin.com/Y1CFrsr2 Edited April 14, 2013 by FusionTech Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/#findComment-1424749 Share on other sites More sharing options...
requinix Posted April 15, 2013 Share Posted April 15, 2013 That code will not run at all, let alone give you the wrong output. Whatever. You already have the usertype in $row['usertype']. Look at that instead. Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/#findComment-1424752 Share on other sites More sharing options...
FusionTech Posted April 15, 2013 Author Share Posted April 15, 2013 Actually, the code does run, It worked, I have my user in the database from when I made my account. Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/#findComment-1424754 Share on other sites More sharing options...
requinix Posted April 15, 2013 Share Posted April 15, 2013 No, it doesn't. if(SELECT * FROM tbl_name WHERE usertype='a';) {That is a syntax error. It will prevent your script from running. Quote Link to comment https://forums.phpfreaks.com/topic/276950-how-to-select-an-enum-type/#findComment-1424767 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.