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 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    41
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Exclamation Undefined Index Problem

    i created an email registration script and when i tried to display all email addresses from it i get an undefined index error.

    Code of test.php
    PHP Code:
    <?php
    require("config.php");
     
    $test mysql_query("SELECT * FROM Email");
      while(
    $row mysql_fetch_array($test))
      {
      echo 
    $row['email'];
      echo 
    "<br />";
      }
      
    mysql_close($con);
    ?>
    Error i get :
    Last edited by hackarchives; 03-09-2012 at 08:58 AM.

  • #2
    Banned
    Join Date
    Apr 2011
    Posts
    656
    Thanks
    14
    Thanked 69 Times in 69 Posts
    So the error message can't be more clear. It's telling what the error is and in what line it's in.

    What's your question?

    Have you confirmed the query actually ran? If yes, then have a look at the column names in the table and I think you'll find a mismatch to what your code is trying to access.
    Last edited by webdev1958; 03-09-2012 at 07:46 AM.

  • Users who have thanked webdev1958 for this post:

    hackarchives (03-09-2012)

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    41
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Sorry, it was a foolish mistake in database.I corrected it.Thanks for help anywayz

  • #4
    Banned
    Join Date
    Apr 2011
    Posts
    656
    Thanks
    14
    Thanked 69 Times in 69 Posts
    glad it's sorted out


  •  

    Tags for this Thread

    Posting Permissions

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