title: How to loop through an array of inputs in a form?
body: <p>I am trying to look through some input fields in a form and add them to a database. The user sets the number of fields, so I can't do something like the code below because there is no specific number of fields.</p>
  
  <pre><code>for($i=0; $i&lt;(number-of-fields); $i++)
  {
      $_REQUEST['Question+$i']
  }
  </code></pre>
  
  <p>I have tried this as well:</p>
  
  <pre><code>&lt;?php
  $con=mysqli_connect("","test","test","Flashcards");
  
  foreach($_REQUEST['Question[]'] as $value)
      {
      $newcards="INSERT INTO Cards(Questions)
      VALUES($value)";
      mysqli_query($con,$newcards);
      }
  
  mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p>It just doesn't add anything to my database. How should I go about doing this? I am new to PHP and SQL and can't seem to figure this out.</p>