Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = 'localhost';
- $user='root';
- $pass='';
- $db='cdkatalog';
- try {
- $con=new mysqli($server,$user,$pass,$db) or die("Greska!");
- } catch (Exception $exc) {
- echo $exc->getTraceAsString();
- }
- $sql='select * from cd';
- $rezultat = $con->query($sql);
- $xml = new DOMDocument('1.0');
- $xml->formatOutput = true;
- $catalog = $xml->createElement('CATALOG');
- $xml->appendChild($catalog);
- while($row=$rezultat->fetch_assoc()){
- $cd = $xml->createElement('CD');
- $cd->setAttribute("id", row['id']);
- $catalog->appendChild($cd);
- $title=$xml->createElement('TITLE');
- $cd->appendChild($title);
- $artist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement