Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 276
0 Users 7 Guests Online
Forum Index » PHP + MySQL » PHP Code Problem?
Posted on Tuesday 8th May 2007 at 08:37 PM
Diablosblizz
templates/default/images/noavatar.png's Avatar
Senior Member
Hey, I am trying to get the email from the member system I got from here. Heres the code that I am trying (everything up to this works):

PHP Code
1
2
3
4
5
case 'send':
$checkuser = $logged[username];
$email = mysql_query("SELECT email FROM members WHERE username = '$checkuser' ORDER BY id DESC") or die (mysql_error());
echo "$email";
break;


I login and everything and I get this:

Resource id #5

Does anybody know what that means?

Thanks!
Posted on Wednesday 9th May 2007 at 03:36 PM
Dean
templates/default/images/noavatar.png's Avatar
Active Member
case send;
$checkuser = $logged[username];
$email = mysql_query("SELECT email FROM members WHERE username = '$checkuser' ORDER BY id DESC") or die (mysql_error());
echo "$email";
break;
Posted on Wednesday 9th May 2007 at 07:20 PM
Diablosblizz
templates/default/images/noavatar.png's Avatar
Senior Member
I got it working thanks to Frihost. But now I have a new error:

http://www.frihost.com/forums/vt-72507.html

Please help :(.
Posted on Wednesday 9th May 2007 at 09:55 PM
DanielXP
avatars/1.png's Avatar
Senior Member
Are you trying to send a email to every one in the database or just 1?
Posted on Thursday 10th May 2007 at 07:47 PM
Diablosblizz
templates/default/images/noavatar.png's Avatar
Senior Member
Just one, go to the link for current status, Frome is trying to help me.. Its weird.
Posted on Thursday 10th May 2007 at 09:00 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
post code up please? might be able to help.
Posted on Thursday 10th May 2007 at 09:09 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
Code

case send;
$username = "$_GET[username]";

$fetch = mysql_query("SELECT * FROM members WHERE username = '$username'") or die (mysql_error());
$users = mysql_fetch_array($fetch);

$email = "$users[email]";
$subject = "put subject here";
$emailbody = "WHATEVER YOU WANT TO SEND";
$from = "From: no-reply@YOURSITE.com";

mail("$email", "$subject", "$emailbody", "$from");
echo ("email has been sent.");
break;


Try that. Sorry for double post.
Posted on Thursday 10th May 2007 at 09:16 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
Also if you wanted to send their pin it would add:
this-
Code

$email = "$users[email]";
$subject = "Pin Reminder";
$emailbody = "
Username: $username
Email Address: $email
Your Pincode: $pincode \n
Your new pincode. \n
Thanks, Diablosblizz.
";
$from = "From: no-reply@YOURSITE.com";

to
Code

$email = "$users[email]";
$pincode = "$users[pincode]";
$subject = "Pin Reminder";
$emailbody = "
Username: $username
Email Address: $email
Your Pincode: $pincode \n
Your new pincode. \n
Thanks, Diablosblizz.
";
$from = "From: no-reply@YOURSITE.com";
Posted on Friday 11th May 2007 at 10:10 PM
Diablosblizz
templates/default/images/noavatar.png's Avatar
Senior Member
I fixed it. Thanks anyways.
Posted on Saturday 12th May 2007 at 02:12 PM
ShadowMage
templates/default/images/noavatar.png's Avatar
Senior Member
Issue has been resolved, Thread Locked.