I don't know if this is the correct Forum to post my request so please feel free to move it if it's not.
I am trying to modify the code in block-Last_5_Articles so that it shows the Topic's title and below it the Article's title. This is what I have done thus far:
It works just fine, but there is one major problem. Instead of the Topic's title, I get the Topic's ID. I think that somehow I should select the 'topictext' from 'nuke_topics' table. My problem is that I don't know how to do that because my knowledge of php and sql is very limited. I think that it could be a very simple task for some of you so could you please paste here the code I should use?
Thank you
webjunky Lieutenant
Joined: May 11, 2003
Posts: 167
Posted:
Sat Mar 11, 2006 1:14 am
Something like this
$content = "<table width=\"100%\" border=\"0\">";
$result = $db->sql_query("SELECT sid, title, topic FROM " . $prefix . "_stories $querylang ORDER BY sid DESC LIMIT 0,5");
while ($row = $db->sql_fetchrow($result)) {
$sid = intval($row['sid']);
$title = stripslashes($row['title']);
$topic = intval($row['topic']);
$result2 = $db->sql_query("SELECT topictext FROM " . $prefix . "_topics WHERE tid='$topic'");
while ($row2 = $db->sql_fetchrow($result2)) {
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum