title: php mysql: Duplicate entry on production but not on dev
body: <p>Oke, i've been busting my head on this one.</p>
  
  <p>I'm gonna try and keep things short, however, if you need more info, don't hesitate to ask.</p>
  
  <p>I've written an import repo for an external firm, so we can import their data into our service.</p>
  
  <h2>quick overview of implemented logic?</h2>
  
  <p>ftp, grab xml file, parse it with simple_xml and do db stuff using laravel eloquent component.</p>
  
  <p>on my dev machine,
  every run gets parsed fully and all data is inserted correctly into the database.</p>
  
  <h2>problem</h2>
  
  <p>when i try the same thing on my production server.
  I'm receiving a duplicate entry error, always on the same exact record. (unless i'm using another file)</p>
  
  <h2>pre script setup to help detect the error</h2>
  
  <p>on each run i do the following:</p>
  
  <ul>
  <li>make sure i'm using the exact same files on both dev and prod
  environment... (i've disabled the ftpgrab and uploaded manually to
  the correct location) </li>
  <li>truncate all the related tables so i'm always
  starting with empty! tables.</li>
  <li>i've manually triple-zillion checked for duplicates in the xml, but they're not in there.... and the fact that
  my dev machine parses the file correctly confirms this.</li>
  </ul>
  
  <h2>what i tried</h2>
  
  <p>at this point, i've got no more clues as to how i'm supposed to debug this properly.</p>
  
  <p>by now, i've checked so many things (most of them i can't even remember), all of which seemed pretty unrelated to me, but i had to try them.
  those things include:</p>
  
  <ul>
  <li>automatic disconnects due to browser</li>
  <li>mysql wait timeouts</li>
  <li>php script timeouts</li>
  <li>memory settings</li>
  </ul>
  
  <p>none of them seem to help (which was exactly what i was expecting)</p>
  
  <h2>another fact</h2>
  
  <p>my php version on my dev is 5.4.4 and the version on the production server is 5.3.2 (i know this is bad practise, but i'm not using any new features, it's really dead easy code, though it has quite a few lines :-) )</p>
  
  <p>i've been suspecting this to be the cause, but</p>
  
  <p>i've now switched to 5.3.14 on my dev... still the import runs without an issue</p>
  
  <p>the changes from 5.3.2 to 5.3.14 are probably pretty minor</p>
  
  <p>i've tried to manually compile the exact same php version, but i'm to inexperienced to properly do this. moreover, it probably wouldn't have the exact same specs anyway (i think it's pretty impossibly to ./configure exactly the same, considering the use of MacOs vs Ubuntu? especially for a noob like me)
  So i've abandoned this path.</p>
  
  <p>I've tried to find the differences in the php versions, but i can't seem to stumble upon anything that might be the cause to all this.
  there was a change related to non-numeric keys in arrays (or strings for that matter) in version 5.4.4 (i think) but since i've now come to the conclusion that 5.3.14 also works, this definitely is not the issue. --- looking around insecurely hoping not having said anything downright stupid ---</p>
  
  <h2>quick thought while writing this:</h2>
  
  <p>the thing is, even though i'm getting the duplicate error statement.
  The record did get inserted into the database.
  moreover, the error gets triggered when having processed about 2700 (of total 6000) records.
  the bound data to the query is actually the data of the second record in the xml file.)</p>
  
  <p>I'm sincerely hoping anyone could put me on the right track for this issue :(
  If you made it this far, but don't have a clue about what's going on, thx for reading and sticking to it.</p>
  
  <p>If you might have clue, please enlighten me!</p>