Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.