title: How to pass information from xslt to mysql
body: <p>i need to know how to link my xsl transformation to my database i currently have it set up doing a html conversion but need to insert the data into a database the xslt is a single file only used for conversion and is run in a php script, i saw a thread on it a few days ago but forgot to save it and now cant for the life of me find anything on this. the xml is a feed not a file this is what the xsl looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="/"&gt;
  &lt;xsl:variable name="ref" select="lr_rates/hoel_ref"/&gt;
       &lt;xsl:for-each select="//room"&gt;
        &lt;xsl:variable name="ref" select="ref"/&gt;
        &lt;xsl:variable name="type" select="type_description"/&gt;
        &lt;xsl:variable name="descr" select="description"/&gt;
        &lt;xsl:variable name="avail" select="rooms_available"/&gt;
        &lt;xsl:variable name="rate" select="rack_rate"/&gt;
        &lt;xsl:variable name="cur" select="rate/requested_currency"/&gt;
      &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>then this is what the database request might look like </p>
  
  <pre><code> "DELETE FROM `pt_rooms` WHERE hotel_ref = '$id'";
   "INSERT INTO `pt_rooms`(hotel_ref,room_ref,room_type,description,availability,price,currency) VALUES ('$id','$ref','$type','$descr','$avail','$rate','$cur')";
  </code></pre>
  
  <p>i think i would probably need a mysql_connect statement as-well as its not an application just a singl xsl in a php script if anyone could link to a good explanation </p>