title: Retrieve Value with insert PDO
body: <p>I'm working on a page where the user can add rows with fields of a form, dynamic, depending on the model this page <a href="http://www.linhadecomando.com/scripts/input-dinamico/" rel="nofollow">http://www.linhadecomando.com/scripts/input-dinamico/</a></p>
  
  <p>I'm having problem RECOVER FROM values ​​of the second row inserted as the first I can get quietly. Check my code:</p>
  
  <pre><code>&lt;?php
  // exibindo os dados
  if ($_POST){
  $IDCliente = $_POST['IDCliente'];
     $IDBanco = $_POST['Banco'];
     $Titular = $_POST['Titular'];
     $Agencia = $_POST['Agencia'];
     $CC = $_POST['CC'];
     $quant_linhas = count($IDBanco);
  
     for ($i=0; $i&lt;$quant_linhas; $i++) {
  
  
  //$pdo = conectar();
  $sql = "INSERT INTO Clientes_Referencias_Bancos (IDCliente, IDBanco, Titular, Agencia, CC) VALUES (:IDCliente, :IDBanco, :Titular, :Agencia, :CC)";
  $cadastrar = $pdo-&gt;prepare($sql);
  $cadastrar -&gt;bindValue(':IDCliente', $IDCliente[$i]);
  $cadastrar -&gt;bindValue(':IDBanco', $IDBanco[$i]);
  $cadastrar -&gt;bindValue(':Titular', $Titular[$i]);
  $cadastrar -&gt;bindValue(':Agencia', $Agencia[$i]);
  $cadastrar -&gt;bindValue(':CC', $CC[$i]);
  $cadastrar -&gt;execute();
  
  
  if($cadastrar-&gt;rowCount() == 1):
  echo "Departamento cadastrado com sucesso!&lt;br/&gt;";
  else:
  echo "Erro ao cadastrar o Departamento!";
  endif;
  
  
  echo  "Cliente: ".$IDCliente[$i]."&lt;br /&gt;";   
  echo  "Banco: ".$IDBanco[$i]."&lt;br /&gt;";
  echo  "Titular: ".$Titular[$i]."&lt;br /&gt;";
  echo  "Agência: ".$Agencia[$i]."&lt;br /&gt;";
  echo  "Conta Corrente: ".$CC[$i]."&lt;br /&gt;";
     }
  }
  ?&gt;
  </code></pre>
  
  <p>Here is my form...</p>
  
  <pre><code>&lt;select name="Banco[]"&gt;
  &lt;input type="text" name="Titular[]" id="Titular[]" /&gt;
  &lt;input type="text" name="Agencia[]" id="Agencia[]" /&gt;
  &lt;input type="text" name="CC[]" id="CC[]" /&gt;
  
  &lt;input name="IDCliente[]" id="IDCliente[]" type="hidden" value="1" /&gt;
  </code></pre>