title: PHP MySQL generating XML shows nothing
body: <p>I need to generate a XML file from a Database, I wrote this PHP code, but it's showing nothing. I first thought the problem was because of a bad connection/query, but that's not the problem. They are both working fine.</p>
  
  <p>I think the problem is the "mysql_fetch_assoc($result)", but I'm not sure because can't really fix it!</p>
  
  <pre><code>&lt;?php
  $con = new mysqli('localhost', 'root', 'usbw', 'bierdb', 3307);
  
  $query = "SELECT biernaam, kleur FROM bier";
  $result = $con -&gt;query($query);
  
  $xml = new XMLWriter();
  
  $xml-&gt;openURI("bieren.xml");
  $xml-&gt;startDocument();
  $xml-&gt;setIndent(true);
  
  $xml-&gt;startElement('kaart');
  
  if(is_resource($result)) {
  
      while ($row = mysql_fetch_assoc($result)) {
          $xml-&gt;startElement("Bier");
  
          $xml-&gt;writeAttribute('kleur', $row['kleur']);
          $xml-&gt;writeRaw($row['biernaam']);
  
          $xml-&gt;endElement();
      }
  
      $xml-&gt;endElement();
  
      header("Content-Type:text/xml");
      echo $xml-&gt;flush();
  }
  ?&gt;
  </code></pre>
  
  <p>Thanks for reading and helping me, I appreciate it!</p>