title: How to solve Notice: Undefined index: id in C:\xampp\htdocs\invmgt\manufactured_goods\change.php on line 21
body: <p>I have a problem with my PHP code saying that "Notice: Undefined index" I am sure its very simple, since I am a beginner i am not getting well what is wrong exactly so please help me.</p>
  
  <p>Here's the code</p>
  
  <pre><code>&lt;?php require_once('../Connections/itemconn.php'); ?&gt;
      &lt;?php   
  
      $id=$_GET['id']; 
  
          $query=mysql_query("select * from manuf where id='$id' ")or die(mysql_error());
          $row=mysql_fetch_array($query);
  
          ?&gt;
  
  &lt;form action="updateprice.php" method="post" enctype="multipart/form-data"&gt;
    &lt;table align="center"&gt;
     &lt;tr&gt;
     &lt;td&gt; &lt;label&gt;&lt;strong&gt;Item Name&lt;/strong&gt;&lt;/label&gt;&lt;/td&gt;
       &lt;td&gt; &lt;label&gt; &lt;?php echo $row['itemname']; ?&gt;&lt;/label&gt;&lt;input type="hidden" name="id" value="&lt;?php echo $id; ?&gt; " /&gt;
       &lt;br /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
  
       &lt;td&gt;&lt;label&gt;&lt;strong&gt;Unit price &lt;/strong&gt;&lt;/label&gt;&lt;/td&gt;
    &lt;td&gt; &lt;input type="text" name="pass" value="&lt;?php echo $row['unitprice']; ?&gt; " /&gt;&lt;br /&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
      &lt;tr&gt;
    &lt;td&gt; 
            &lt;input type="reset" name="Reset" value="CANCEL" /&gt;
        &lt;br&gt;&lt;/td&gt;
  
  
       &lt;td&gt; 
            &lt;input type="submit" name="Submit2" value="Update" /&gt;      &lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>