Jump to content

Forums help


EchoFool

Recommended Posts

I am building myself a forum which is pretty hard going. I have a query which is loading the posts for the relevant thread.

 

Now the two variables in determining which thread the user is viewing is "catergory" (where the thread is.. such as offtopic/general discussion ) etc

And "thread" (the ID of the thread).

Now the variables work but the query does not load the posts related to the thread. Was hoping some one may be able to see what i am missing....

 

This is what i got:

<?php
$Get = mysql_query("SELECT posts.* FROM posts,forums WHERE forums.Catergory='$Catergory' AND forums.ThreadID='$Thread' AND posts.Status!='2'
AND posts.ThreadID='$Thread' ORDER BY posts.PostID ASC")
Or die(mysql_error());
If(mysql_num_rows($Get) < 1){
Echo 'There was an error!';
}
?>

 

At the moment I am always getting the "There was an error". Not sure why it wont let find the correct posts ...

Link to comment
Share on other sites

yeah my bad forgot i had that there when i was pasting it across.. have updated it, although that wasn't what was causing the problem, as the query wouldn't load the posts anyway... :(

 

My tables are like this:

 

forum table

Thread    |  Catergory  |  Locked

posts table

PostID  | ThreadID  |  UserID  | Message | Status

 

Hope you can help

Link to comment
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.