title: php variables unidentified index
body: <p>I'm still a beginner to php and I cannot seem to understand what's wrong here. The code still works even though there's an 'unidentified index' error. The error I get would be referring to the variables $food, $calories, $healthy, $submit.</p>
  
  <p>The code is:</p>
  
  <pre><code>&lt;?php
  
  require 'connect.inc.php';
  
  $foodname = $_POST['food_name'];
  $calories = $_POST['calories'];
  $healthy = $_POST['healthy_unhealthy'];
  $submit_button = $_POST['submit'];
  
  $sql="INSERT INTO `food` (`food`, `calories`, `healthy_unhealthy`) VALUES('$foodname', '$calories', '$healthy')";
  
  if(isset($submit_button)&amp;&amp;!empty($foodname)&amp;&amp;!empty($calories)&amp;&amp;!empty($healthy))
  {
      mysql_query($sql, $conn);
  }
  else{
  echo'Kindly fill in fields';
  }
  
  ?&gt;
  &lt;form action="insert.php" method="POST"&gt;
  Food Name:&lt;br&gt;
  &lt;input type="text" name="food_name"&gt;&lt;br&gt;
  Calories:&lt;br&gt;
  &lt;input type="text" name="calories"&gt;&lt;br&gt;
  Healthy:&lt;br&gt;
  &lt;input type="text" name="healthy_unhealthy"&gt;&lt;br&gt;
  &lt;input type="submit" name="submit"&gt;
  &lt;/form&gt;
  </code></pre>