View Full Version : Undefined Variable(s)

11-03-2012, 09:22 PM
Hello I am getting the following error messages:

Notice: Undefined index: player_email in C:\wamp\www\new_lost_password.php on line 67

I have the following code:

$ifOnlyMailMatches = mysql_query("SELECT Player_number from players where player_email like '$mail' or player_email2 like '$mail' AND Inactive_player = 0 LIMIT 1") or die (mysql_error());
if ($number == 1)
echo "IfOnlyMailMatches";
while($row = mysql_fetch_array($ifOnlyMailMatches))
$mail2 = $row['player_email'];
echo $mail2;
$mail1 = $row['player_email2'];
echo $mail;

I didn't think there was a need to declare the player_mail since I am grabbing it from a db.

The lines with the errors are in bold.

11-03-2012, 09:37 PM
Have you done a print_r ($row) to see what you're getting from the DB?