I am new at PHP and I created a login/registration area. All is working quite well, but I have one thing that keeps going wrong. After a user has successfully registered, an automated email is sent with their login details: Username= X and Password= Y. All is shown in the message, except the username. How can I get that info (=data) from my mysql database in the message?

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

What other variables do you have in the code? I see $pass but is there a $username variable as well?
–
JoshSep 22 '12 at 7:01

No, I don't have the variable $username yet. How to set this up and connect with the value in my mysql database?
–
Paul De MeulenaerSep 22 '12 at 7:15

You should never store the password in plaintext.
–
sentient meatNov 18 '13 at 21:53