<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — unable to fetch topic list]]></title>
		<link>https://punbb.informer.com/forums/topic/26023/unable-to-fetch-topic-list/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/26023/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in unable to fetch topic list.]]></description>
		<lastBuildDate>Thu, 18 Apr 2013 21:37:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[unable to fetch topic list]]></title>
			<link>https://punbb.informer.com/forums/post/148896/#p148896</link>
			<description><![CDATA[<p>Hello,</p><p>I&#039;ve been using the following script to fetch important posts from my forums and display them as &quot;news&quot; on the main page of my website:</p><div class="codebox"><pre><code>&lt;?php

/**
Punbb News Script
Written by: Jesse Spillane (http://www.jessespillane.com)
*/

$news_forum_id = 21;
$news_forum_id2 = 2;
$news_forum_id3 = 5;
$news_forum_id4 = 14;
$limit = 7;
$forum_path = &#039;./forums/&#039;;

define(&#039;PUN_ROOT&#039;, $forum_path);

define(&#039;PUN_TURN_OFF_MAINT&#039;, 1);
define(&#039;PUN_QUIET_VISIT&#039;, 1);

require PUN_ROOT.&#039;include/parser.php&#039;;
$result = $db-&gt;query(&#039;select id, subject, num_replies, posted from &#039;.$db-&gt;prefix.&#039;topics WHERE forum_id=&#039;.$news_forum_id.&#039; OR forum_id=&#039;.$news_forum_id2.&#039; OR forum_id=&#039;.$news_forum_id3.&#039; OR forum_id=&#039;.$news_forum_id4.&#039; OR forum_id=&#039;.$news_forum_id5.&#039; ORDER BY -posted LIMIT &#039;.$limit.&#039;;&#039;)or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());
while ($row = $db-&gt;fetch_assoc($result))
{
    $id = $row[&#039;id&#039;];
    $subject = $row[&#039;subject&#039;];
    $num_replies = $row[&#039;num_replies&#039;];
    $posted = date(&quot;F j, Y, g:i a&quot;, $row[&#039;posted&#039;]);

    $result2 = $db-&gt;query(&#039;select message, poster from &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; ORDER BY id LIMIT 1 &#039;)or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());
    
    $post = $db-&gt;fetch_assoc($result2);
    $message = parse_message($post[&#039;message&#039;], 1);
    $poster = $post[&#039;poster&#039;];

?&gt;
&lt;br&gt;
&lt;table bgcolor=&quot;#171717&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;650&quot; height=&quot;68&quot;&gt;
  &lt;tr&gt;
    &lt;td width=&quot;650&quot; height=&quot;23&quot; background=&quot;images/cellpic2.gif&quot; colspan=&quot;2&quot;&gt;    &lt;p style=&quot;margin: 1 10&quot;&gt;
    &lt;font face=&quot;tahoma&quot; style=&quot;font-size: 11pt&quot; color=&quot;#FFFFFF&quot;&gt;&lt;b&gt;&lt;?php echo &#039;&lt;a href=&#039;.$forum_path.&#039;viewtopic.php?id=&#039;.$id.&#039;&quot;&gt;
    &lt;/font&gt;&lt;font face=&quot;Arial&quot; size=&quot;2&quot; style=&quot;font-size: 11pt&quot;&gt;&#039;.$subject.&#039;&lt;/a&gt;&#039;; ?&gt;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width=&quot;650&quot; height=&quot;26&quot; colspan=&quot;2&quot;&gt;&lt;font face=&quot;tahoma&quot; size=&quot;2&quot; color=&quot;#FFFFFF&quot;&gt;&lt;p style=&quot;margin: 1 10&quot;&gt;&lt;?php echo $message;?&gt;&lt;/font&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width=&quot;527&quot; height=&quot;19&quot;&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td width=&quot;123&quot; height=&quot;19&quot; background=&quot;images/cellpic2.gif&quot;&gt;
    &lt;p align=&quot;right&quot; style=&quot;margin: 4 10&quot;&gt;&lt;i&gt;
    &lt;font face=&quot;tahoma&quot; style=&quot;font-size: 9pt&quot; color=&quot;#FFFFFF&quot;&gt;&lt;?php
    echo &#039;&lt;a style=&quot;text-decoration: none&quot; href=&#039;.$forum_path.&#039;viewtopic.php?id=&#039;.$id.&#039;&quot;&gt;
   &#039;.$num_replies.&#039; Comment(s)&lt;/a&gt;&#039;;
   ?&gt;&lt;/font&gt;&lt;/i&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;



&lt;?php

}

?&gt;</code></pre></div><p>After making a backup of my website &amp; relocating it to a new server, I am getting this error:</p><div class="codebox"><pre><code>An error was encountered
Error: Unable to fetch topic list.</code></pre></div><p>I have double checked the database information and it is correct, the topic IDs are correct, So I&#039;m confuised at what might be wrong. Can someone maybe help?</p><p>Regards,<br />Juston</p>]]></description>
			<author><![CDATA[null@example.com (DrEvil)]]></author>
			<pubDate>Thu, 18 Apr 2013 21:37:07 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/148896/#p148896</guid>
		</item>
	</channel>
</rss>
