コードを見ずに、その数値はおそらく topic_links から来ていると思います。たとえば次のようになります。
topic_links
select * from topic_links where topic_id=1234
ただし、これはバグのようです。