title: PHP import entries from .csv file - MySQL query issues
body: <p>I am trying to import some entries from a .csv file into my actual database. I have done this a thousand times without any issues. Starting with yesterday, I can't import it anymore.</p>
  
  <p>I am always getting this error:</p>
  
  <pre><code>Error Number: 1242
  
  Subquery returns more than 1 row
  
  UPDATE preturi_import I SET I.art_id = ( SELECT ART_ID FROM tof_articles WHERE I.art_nr = ART_ARTICLE_NR AND I.sup_id = ART_SUP_ID ) WHERE I.sup_id &gt; 0
  
  Filename: /home/pieseaut/public_html/controllers/backend.php
  
  Line Number: 1647
  </code></pre>
  
  <p>Since the script was working just fine until yesterday and I haven't done any modifications to the script I really can't understand what the problem might be.</p>
  
  <p>The exact mysql query is as follows:</p>
  
  <pre><code> $sqlUpdate = "UPDATE preturi_import I SET I.art_id = (SELECT ART_ID FROM tof_articles WHERE I.art_nr = ART_ARTICLE_NR AND I.sup_id = ART_SUP_ID) WHERE I.sup_id &gt; 0";
  </code></pre>
  
  <p>No matter if in that .csv files is one single entry or a few tens or hundreds or thousands, I always get the same error as mentioned at the beginning.</p>
  
  <p>There was one issue though. For some stupid reason the /tmp partition on my CentOS server got full and some mysql tables crashed. I have used mysqlcheck with --repair option to fix them and also myisamchk. I have restarted mysql service and I see no errors with those tables.</p>
  
  <p>Any help is really appreaciated!</p>