<?
header('Content-type: text/xml'); 
?>

<rss version="2.0">
<channel>
<title>Lekkner - Recent Additions</title>
<description>One of a kind handmade one of a kind clothing, scarves, pillows, custom reconstructed t-shirts and more</description>
<link>http://lekkner.com/</link>

<?php

$i=1;
$no_of_prods=0;


include("../x/conf.php");

$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query ="SELECT prod_tbl.*, prod_tbl.name as ProdName, prod_tbl.id as TheNumber from prod_tbl INNER JOIN cat_tbl ON prod_tbl.cat_id = cat_tbl.id WHERE prod_tbl.isnew = 1 ORDER BY prod_tbl.id DESC limit 30";

$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result)){
$theprodname[$i]= $row["ProdName"];
$theid[$i]= $row["TheNumber"];
$thethumbnail[$i] = $row["thumbnail"];
$forsale[$i] = $row["sold"];
$theprice[$i] = $row["price"];
$i++;
}
}

$no_of_prods=$i;

?>

<? $i=1;

	while($i < $no_of_prods)
	{

?>
	  
<? 
$hedstrong[$i] = htmlentities($theprodname[$i]);

?>

<? echo"<item>
<title>$hedstrong[$i] - &#36;$theprice[$i]</title>
<description><![CDATA[ <img src='http://leknner.com/img/$thethumbnail[$i]' alt='$hedstrong[$i]' /> ]]>
</description>
<link>http://lekkner.com/shop/item.php?id=$theid[$i]</link>

</item>" ?>

<?
$i++;
	}
?>

</channel>
</rss>