title: How to insert multiple records without primary key in Fat-Free Framework
body: <p>I try to insert multiple records to a no PK table</p>
  
  <pre><code>for ($x = 0; $x &lt; count($arr); $x++) {
      $name=$arr[$x];
      $user=new DB\SQL\Mapper($f3-&gt;get('DB'),'User');
      $user-&gt;name=$name;
      $user-&gt;save();
  }
  </code></pre>
  
  <p>Finally, only one record inserted to database</p>
  
  <p>I also tried <code>reset</code>, but still only one record</p>
  
  <pre><code>for ($x = 0; $x &lt; count($arr); $x++) {
      $name=$arr[$x];
      $user=new DB\SQL\Mapper($f3-&gt;get('DB'),'User');
      $user-&gt;reset();
      $user-&gt;name=$name;
      $user-&gt;save();
  }
  </code></pre>
  
  <p>If I add an auto_increment primary key to this table, then it is no problem.</p>
  
  <hr>
  
  <p>Update 1:</p>
  
  <p>I tested the problem again in web browser. And then I got this error</p>
  
  <pre><code>Internal Server Error
  
  PDOStatement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  </code></pre>
  
  <p>So I cannot execute <code>$db-&gt;log()</code> after <code>save()</code>, and now I know why there is only one record, because php stopped in first loop.</p>
  
  <p>And then I enable <code>general_log_file</code>, and I found this log in the file</p>
  
  <pre><code>160621 18:00:53    47 Connect   dev@localhost on my_db
             47 Query SET NAMES utf8
             47 Query SHOW columns FROM `my_db`.`UserAccount`
             47 Query INSERT INTO `UserAccount` (`name`) VALUES ('uName')
             47 Quit  
  </code></pre>
  
  <p>So I try to run this SQL <code>INSERT INTO `UserAccount` (`name`) VALUES ('uName')</code> and got no error.</p>
  
  <p>I also checked <code>/var/log/mysql.log</code> and <code>/var/log/mysql.err</code> is empty.</p>
  
  <p>Now I have no idea how to find out the problem</p>