DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Output Feedwordpress Database For Use In Planet

  • submit to reddit
        You'll need to change the initial settings as I didn't bother to read them from the Wordpress config file.  You may also need to change the table name (wp_links) in the sql query.

$username = "myuser";
$password = "P455w0rd";
$database = "db_name";
$hostname = "";

$query = "SELECT link_name, link_rss FROM wp_links WHERE link_category=2";

mysql_connect($hostname, $username,$password);
@mysql_select_db($database) or die("Unable to select database");
$result = mysql_query($query);
$num = mysql_numrows($result);

while($i < $num) {
        $rss = mysql_result($result,$i,"link_rss");
        $name = mysql_result($result,$i,"link_name");

        echo "[".$rss."]\r\n";
        echo "name = ".$name."\r\n";