Jump to content

real confused, please help, thanks!


skateis2s

Recommended Posts

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

Link to comment
Share on other sites

$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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.