<?php
$output = '<items>';
$db = new SQLite3('./.db.db');
$res = $db->query("SELECT * FROM store");
while ($row = $res->fetchArray()) {
    $added_date = $row['added_date'];
    $description = $row['description'];
    $icon = $row['icon'];
    $name = $row['name'];
    $url = $row['url'];
    $version = $row['version'];
    $version_code = $row['version_code'];
    if(!empty($url))
    {
    $output.='
<item>
<id>'.$row['id'].'</id>
<cat>'.$version.'</cat>
<name>'.$name.'</name>
<source>'.$url.'</source>
<imge>'.$icon.'</imge>
<desc></desc>
<vers>'.$version_code.'</vers>
<vidz></vidz>
<base64>'.$description.'</base64>
</item>';
    }
}
$x = substr($output, -1);
if($x == ",")
{
    $output=substr_replace($output,"",-1);
}
$output.='
</items>';
echo $output;
?>