This is the current code for my RSS Feed:
<?php header("Content-type: text/xml"); ?>
<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<?php include('directory/database.php'); ?>
<rss version="2.0">
<channel>
<title>Website Reviews</title>
<link>http://www.mywebsite.com</link>
<description>My Website's Description</description>
<pubDate><?echo date('Y/m/d H:i:s');?></pubDate>
<?php
foreach( range( 1, 30 ) as $i ):
$domain = mt_rand( 1, 62246 );
?>
<item>
<title><?php echo $domain; ?> REVIEW</title>
<pubDate><?echo date('Y/m/d H:i:s');?></pubDate>
<link>http://www.mywebsite.com/review/<?php echo $domain; ?></link>
<description>Looking for a review on <?php echo $domain; ?>? We've got it!</description>
</item>
<?php endforeach; ?>
</channel>
</rss>
This is the specific code that I need help changing:
<?php
foreach( range( 1, 30 ) as $i ):
$domain = mt_rand( 1, 62246 );
?>
Basically instead of generating a random number, I need it to pull one of the domain names from my database. I have a large list of domains in my database in the table "list" under the column "website".
I have 30 different RSS items displaying and each needs to have a different domain name associated with the item. Thanks in advance!