title: Notice: Undefined index: id in
body: <p>The code i have written works but I still keep getting:</p>
  
  <blockquote>
    <p>Notice: Undefined index: id in C:\xampp\htdocs\portfolio\periode4\graden\array.php on line 35.</p>
  </blockquote>
  
  <p>Does anyone know what I have to do to take away the notice?</p>
  
  <pre><code>&lt;?php
  function connect()
    {
      // Make a MySQL Connection
      $link = mysqli_connect("localhost", "root", "", "school") or die(mysqli_error());
      return $link;
    }
  
  
  if($_GET) {
      $id = $_GET["id"];
  }
  
  // select query 
  $query = "SELECT * FROM graden" ;
  
  
  $result = mysqli_query(connect(),$query);   
  
  
  // tabel maken
  $table = "&lt;table border='1'&gt;";
  
  $table .= "&lt;tr&gt;
               &lt;th&gt; ID &lt;/th&gt;
               &lt;th&gt;Graden Celcius&lt;/th&gt; 
               &lt;th&gt;Aanduiding&lt;/th&gt;
               &lt;th&gt;Image&lt;/th&gt; 
          &lt;/tr&gt;";
  
  
  // keeps getting the next row until there are no more to get
      while($row = mysqli_fetch_assoc( $result )) {
  
      $table .="&lt;tr ".($_GET['id'] == $row['id']?" style='background-color:yellow'":"")."&gt;";
  
      // Print out the contents of each row into a table
      foreach ($row as $key =&gt; $value)
          {
              if ($key == "Image")
              {
                  $table .="&lt;td&gt;&lt;img src='$value' /&gt;&lt;/td&gt;"; 
              }
                  elseif ($key == "id")
                  {
                      $table .="&lt;td&gt;&lt;a href='array.php?id=$value'&gt;$value&lt;/a&gt;&lt;/td&gt;"; 
                  }
                      else
                      {
                          $table .="&lt;td&gt;$value&lt;/td&gt;";         
                      }
  
          }
          $table .= "&lt;/tr&gt;";
          }
          $table .="&lt;/table&gt;";
  
          echo $table;
      // optie lijst
  
  //maken select query
  
  $query = "SELECT id, temp FROM graden ";
  
  
  //uitvoeren select query
  $result = mysqli_query(connect(), $query) ;
  
  
      //tonen alle gegevens
      $select = "
          &lt;form action=\"array.php\" method=\"get\"&gt;\n
              &lt;select name=\"id\"&gt;\n
                  &lt;option value='id'&gt;---all---&lt;/option&gt;\n
      ";
      while($row = mysqli_fetch_assoc( $result ))
          {
              $select .= "&lt;option value='".$row['id']."'&gt;".$row["temp"]."&lt;/option&gt;\n"; 
          }
              $select .= "&lt;/select&gt;\n";
              $select .= "&lt;input type=\"submit\"&gt;\n";
              $select .= "&lt;/form&gt;\n";
  
      echo $select;
  </code></pre>