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>" خط سبز "</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_ass oc($result )){
echo '<item>';
echo '<pubDate>'.$row['date'].' </pubDate> ';
echo '<pubTime>'.$row['time'].' </pubTime> ';
echo '<title>'.$row['title'].'< /title>';
echo '<link>'.$row['code'].'</l ink>';
echo '<description>'.$row['desc ription']. '</descrip tion>';
echo '</item>';
}
echo '</channel>';
echo '</rss>';
?>
<?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>" خط سبز "</description>';
require_once 'kamen/serverdata.php';
$conn = mysql_connect("$dbHost","$
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_ass
echo '<item>';
echo '<pubDate>'.$row['date'].'
echo '<pubTime>'.$row['time'].'
echo '<title>'.$row['title'].'<
echo '<link>'.$row['code'].'</l
echo '<description>'.$row['desc
echo '</item>';
}
echo '</channel>';
echo '</rss>';
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.