EchoFool Posted February 16, 2008 Share Posted February 16, 2008 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 ... Quote Link to comment Share on other sites More sharing options...
peranha Posted February 16, 2008 Share Posted February 16, 2008 you are closing you PHP tag and then putting in the echo command. then openning it again after the echo command, to it is taking it as HTML. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted February 16, 2008 Author Share Posted February 16, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.