# Php script to make xml

**URL:** <https://forum.kirupa.com/t/php-script-to-make-xml/155720>\
**Category:** Uncategorized\
**Created:** [July 19, 2005, 8:55pm UTC](https://forum.kirupa.com/t/php-script-to-make-xml/155720 "2005-07-19T20:55:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlon](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@marlon](https://forum.kirupa.com/u/marlon)\
**Post date:** [July 19, 2005, 8:55pm UTC](https://forum.kirupa.com/t/php-script-to-make-xml/155720/1 "2005-07-19T20:55:52Z")

</div>

Hello!  
now i’ve got this code

\<?php  
header(“Content-type: text/xml”);  
$host = “localhost”;  
$user = “albertart”;  
$pass = “aLb44TA”;  
$database = “albert-artgallery\_com\_-\_shop”;  
$linkID = mysql\_connect($host, $user, $pass) or die(“Could not connect to host.”);  
mysql\_select\_db($database, $linkID) or die(“Could not find database.”);  
$query = “SELECT \* FROM product ORDER BY name DESC”;  
$resultID = mysql\_query($query, $linkID) or die(“Data not found.”);  
$xml\_output = "\<?xml version=“1.0” encoding=“UTF-8”?\>  
";  
$xml\_output .= "\<photoalbum\>  
";  
$xml\_output .= " \<parameters noofcolumn=“6” noofrow=“1” thumbxs=“40” thumbys=“550” thumbwidth=“120” thumbheight=“113”/\>  
";  
$xml\_output .= " \<album albumname=“album1”\>  
";  
$xml\_output .= " \<images\>  
“;  
for($x = 0 ; $x \< mysql\_num\_rows($resultID) ; $x++){  
$row = mysql\_fetch\_assoc($resultID);  
$xml\_output .= " \<name=” . $row[‘picturet’] . "/\>  
";  
}  
$xml\_output .= " \</images\>  
";  
$xml\_output .= " \</album\>  
";  
$xml\_output .= “\</photoalbum\>”;  
echo $xml\_output;  
?\>

by xml\_output.=" \<name=". $row[‘picturet’] . "/\>  
;  
he gives a fold. i want it to be this in xml

\<name=“1 1-2-3.jpg”/\>
