Public paste
Versie 5
By: Xmoo | Date: Sep 26 2008 12:55 | Format: PHP | Expires: never | Size: 1.11 KB | Hits: 1185

  1. <?php
  2.  
  3. $db=mysql_connect("localhost","root");
  4. mysql_select_db("xmltoets",$db);
  5.  
  6. $xml.= "<?xml version='1.0' encoding='ISO-8859-1'?>n";
  7. $xml.= "<!DOCTYPE planten SYSTEM 'versie5.dtd'>n";
  8. $xml.= "<planten>n";
  9.  
  10. $abc=mysql_query("SELECT * FROM artikelen WHERE ned='Bergden'");
  11. while (list($Artikelnr, $Naam, $Ned, $Vorm, $Kenmerk, $Prijs, $Soort, $Productgroep) = mysql_fetch_row($abc)){
  12.    $xml.= "<plant>n";
  13.    $xml.= "<naam>$Naam</naam>n";
  14.    $xml.= "<soort>$Soort</soort>n";
  15.    $xml.= "<prijs>$Prijs</prijs>n";
  16.    $xml.= "<ned>$Ned</ned>n";
  17.    $xml.= "</plant>n";
  18.  
  19.    $cba=mysql_query("SELECT * FROM artikelen WHERE ned='Bruidsbloem'");
  20.    while (list($Artikelnr, $Naam, $Ned, $Vorm, $Kenmerk, $Prijs, $Soort, $Productgroep) = mysql_fetch_row($cba)){
  21.    $xml.= "<plant>n";
  22.    $xml.= "<naam>$Naam</naam>n";
  23.    $xml.= "<soort>$Soort</soort>n";
  24.    $xml.= "<prijs>$Prijs</prijs>n";
  25.    $xml.= "<ned>$Ned</ned>n";
  26.    $xml.= "</plant>n";
  27.    }
  28.  
  29. }
  30. $xml.= "</planten>n";
  31.  
  32. $file=fopen("versie5.xml","w");
  33. fputs($file,$xml);
  34. fclose($file);
  35.  
  36. header ("content-type: text/xml");
  37. echo $xml;
  38. ?>