title: I am getting Notice: Undefined variable: i in C:\xampp\htdocs\search-engine\search\search.php on line 23
body: <p>I am getting  Notice: Undefined variable: i in C:\xampp\htdocs\search-engine\search\search.php on line 23   </p>
  
  <pre><code>     foreach ($terms as $each) {
  
           $i++;
  
           if ($i == 1)
               $query .= "keywords LIKE '%$each%' ";  
           else
               $query .= " OR keywords LIKE '%$each%' ";
  
       }
  </code></pre>