Jump to content


Photo

real confused, please help, thanks!


  • Please log in to reply
1 reply to this topic

#1 skateis2s

skateis2s
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 24 February 2003 - 08:21 PM

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

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 24 February 2003 - 10:02 PM

$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...
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users