Link to home
Start Free TrialLog in
Avatar of sam20
sam20

asked on

RSS feed not showing item time

The time displays on RSS feed items is not correct, it is not  the time when the item was created and saved in database. Can you please tell me that how I can correct it. Please see the code bellow. You can see the result here: http://khatesabz.info/rss.php

<?php
echo '<?xml version="1.0" ?>';
echo '<rss version="2.0">';
echo '<channel>';
echo '<title>RSS Feed</title>';
echo '<link>http://--.info</link>';
echo '<language>fa</language>';
echo '<description>" &#1582;&#1591; &#1587;&#1576;&#1586; "</description>';

require_once 'kamen/serverdata.php';
$conn = mysql_connect("$dbHost","$dbUser","$dbPass");
mysql_query('SET NAMES utf8');
$db = mysql_select_db("$dbName");
mysql_query("SET CHARACTER_SET_RESULTS=NULL");
$sql = "SELECT * FROM lastnews ORDER BY id DESC LIMIT 15";
$result = mysql_query($sql);
while($row=mysql_fetch_assoc($result)){
echo '<item>';
echo '<pubDate>'.$row['date'].'</pubDate>';
echo '<pubTime>'.$row['time'].'</pubTime>';
echo '<title>'.$row['title'].'</title>';
echo '<link>'.$row['code'].'</link>';
echo '<description>'.$row['description'].'</description>';
echo '</item>';
}
echo '</channel>';
echo '</rss>';
?>
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial