Jump to content

Archived

This topic is now archived and is closed to further replies.

skateis2s

real confused, please help, thanks!

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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

×

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.