title: Getting Warning: Invalid argument supplied for foreach() when i leave interest filed empty?
body: <p>I have an Interest areas in my page when i register new user and when leaving Interest Area selection filed default (empty) I'm getting this error
  Here is the code:</p>
  
  <pre><code>    91-    //Interest
      92-     foreach ($_POST['interest_id'] as $interest)
      93-     {
      94-         $query = "INSERT INTO user_interest (user_id, interest_id)
      95-                 VALUES  ('$user_id', '$interest')";
      96-         $result = mysqli_query($link,$query);
      95-     }
  </code></pre>
  
  <p>and this is my <strong>Interest Areas</strong> part in the page :</p>
  
  <pre><code>&lt;label&gt;Research Areas&lt;/label&gt;
        &lt;select name="interest_id[]" class="small-input" multiple&gt;
          &lt;?php 
              $query = "SELECT * FROM research_interest ORDER BY name ASC";
              $result = mysqli_query($link, $query);
              while($row = mysqli_fetch_object($result))
              {
          ?&gt;
              &lt;option value="&lt;?php echo $row-&gt;id; ?&gt;"&gt;&lt;?php echo $row-&gt;name; ?&gt;&lt;/option&gt;
          &lt;?php
              }
          ?&gt;
        &lt;/select&gt;
      &lt;/p&gt;
  </code></pre>