title: Edit XML data and import to SQL table
body: <p>I have an XML feed from a wholesaler that is updated periodically to show the stock quantities of the items they wholesale. I need some help in collecting that XML file data twice a day and importing it into the SQL table on my website. Here is an example of the XML file:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='ISO-8859-1'?&gt;
  &lt;!DOCTYPE stockreport SYSTEM
  'http://www.wholesalewebsite/feeds/status.dtd'&gt;
  &lt;stockreport&gt;
      &lt;timestamp&gt;14/07/2014 18:55:26&lt;/timestamp&gt;
  &lt;version&gt;2.0&lt;/version&gt;
      &lt;products&gt;
              &lt;product type="main"&gt;
                       &lt;code&gt;M0507&lt;/code&gt;
                       &lt;name&gt;Example Product&lt;/name&gt;
                       &lt;stock&gt;4&lt;/stock&gt;
                       &lt;status&gt;In Stock&lt;/status&gt;
              &lt;/product&gt;
       &lt;/products&gt;
  &lt;/stockreport&gt;
  </code></pre>
  
  <p>I need to use this feed to update the quantities of the items in my store. My SQL table is called prods_stock and in the table the code (M0507) is called customid and stock is called quantity, so I need to alter the XML fields to match my existing table fields and then update the quantities using the customid(code) as an anchor point. I can ignore name and status.</p>
  
  <p>How would I go about doing this?</p>
  
  <p>Thanks in advance</p>
  
  <p>Thanks for the suggestions, as I am not very good with coding etc... I have decided to just manually insert an sql query daily to update the database. An example of the code I will use is:
      UPDATE products_stock SET customid = 'n12',quantity = 10 WHERE 1=1 AND    customid= 'n12';
      UPDATE products_stock SET customid = 'n50',quantity = 10 WHERE 1=1 AND  customid= 'n50';</p>
  
  <p>I will be using a csv feed file from the wholesaler and getting the info from there. Is there an easier/quicker way to drag the info from the csv file and update the table, rather than manually type the code for each line?</p>
  
  <p>Thanks </p>