Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    39
    Thanks
    0
    Thanked 1 Time in 1 Post

    Undefined Variable(s)

    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:
    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());
    				$number=mysql_num_rows($ifOnlyMailMatches);
    				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.

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,224
    Thanks
    10
    Thanked 269 Times in 268 Posts
    Have you done a print_r ($row) to see what you're getting from the DB?

    Dave


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •