How to retrive only one cell from MySQL table with PHP
- by JuanCee
I'm trying to create a forgotten password form that emails users their password. I'm having a problem, though, with the actual password part. You see, I have the email and comparing the email correct, except whenever I send the email I always get either "Your password is ." or "Your password is Array". I'm using:
$check_email = mysql_num_rows(mysql_query("SELECT email FROM userRecovery WHERE email = '$to'"));
if($check_email == 1){
$qtip = mysql_query("SELECT password FROM userRecovery WHERE email = '$to'");
$theirPassword = mysql_fetch_array($qtip);
Rest of the Code...
}
I used to be able to do this correctly, but I haven't done PHP or MySQL in too long so it's slightly annoying (that, and I'm at a beginner-intermediate kind of level). I remember having this exact problem, but I don't have the code with me to find out what I did. If you think I left out a detail, please say so.
Any help if appreciated.