How to retrive only one cell from MySQL table with PHP

Posted by JuanCee on Stack Overflow See other posts from Stack Overflow or by JuanCee
Published on 2011-01-02T00:05:20Z Indexed on 2011/01/02 1:54 UTC
Read the original article Hit count: 493

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql