skateis2s Posted February 24, 2003 Share Posted February 24, 2003 hello, if you help me, i really appreciate it, im working on a script and i have a table called \"users\" and a field called \'emailactive\'. emailactive is a tinyint(1) and default is 0 $activate = mysql_query (\"SELECT emailactive FROM users WHERE name = \'\".$logged_in_user.\"\'\"); $result = mysql_query (\"SELECT * FROM users WHERE name = \'\".$logged_in_user.\"\'\"); if($row=mysql_fetch_array($result)) { echo \"Welcome, \".$logged_in_user.\". You are now in the members section!<br>\"; echo \"<a href=\'profile.php?name=\".$logged_in_user.\"\'>Edit your Profile</a> / <a href=\'viewprofile.php?name=\".$logged_in_user.\"\'>View your Profile</a> / <a href=\'upload.php?name=\".$logged_in_user.\"\'>Upload a File</a><br>\"; if ($activate == 0) { echo \"<a href=\'cpemail.php?name=\".$logged_in_user.\"\'>Activate your IS2S email</a><br>\"; } else if ($activate == 1) { echo \"Your email is activated nimwit<br>\"; } but on the last few lines where it says if ($activate == 0) { echo \"<a href=\'cpemail.php?name=\".$logged_in_user.\"\'>Activate your IS2S email</a><br>\"; } else if ($activate == 1) { echo \"Your email is activated nimwit<br>\"; } im trying to say if the field \'emailactive\' has a 1 in it, do this if it has a 0 do this, please help me, thankyou very much Quote Link to comment https://forums.phpfreaks.com/topic/179-real-confused-please-help-thanks/ Share on other sites More sharing options...
shivabharat Posted February 24, 2003 Share Posted February 24, 2003 $activate = mysql_query (\"SELECT * FROM users WHERE name = \'\".$logged_in_user.\"\'\"); printf(\"Activate: %d<br>n\",mysql_result($activate,0,\"emailactive\")); 0 - the field position change that if required See whether u are able to see th value I guess the problem is in getting the value and I am not sure what u have done is correct. Try this.......let see if it works... Quote Link to comment https://forums.phpfreaks.com/topic/179-real-confused-please-help-thanks/#findComment-514 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.