Jump to content

Need help with DB Logic


gaza165

Recommended Posts

I am creating a forum

 

it goes like this

 

There are topics such as PHP Help, CSS and XHTML Help

 

Inside topics there are forums ... i.e

 

PHP Help >>> General PHP Help

 

I am trying to bring back a list of topics from the database including their forums so like

 

PHP Coding

      General PHP Help

      Advanced PHP

 

CSS AND XHTML

      Basic CSS

 

This is the SQL query i have but it doesnt seem to come out as expected....

 

<?php

include ("dbconnect/dbconnect.php");

$result = mysql_query("SELECT forum.forum_id, forum.title, forum.description, topics.topic_title
FROM forum INNER JOIN topics ON forum.topic_id = topics.topic_id GROUP BY topics.topic_title ");


while($rs = mysql_fetch_array($result))			
{
echo $rs['topic_title'];
echo "<table width='100%' class='forumtable'>";
echo "<tr'>";
echo "<td>"."<h1><a href='forum.php?forum_id=".$rs['forum_id']."'>".$rs['title']."</a></h1>"."<p>".$rs['description']."</p></td>";
echo "</tr>";
}
echo "</table>";

 

can someone take a look and tell me where i am going wrong??

Link to comment
https://forums.phpfreaks.com/topic/131087-need-help-with-db-logic/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.