phpSensei Posted July 11, 2007 Share Posted July 11, 2007 Can someone please tell why this keeps coming up whenever I view one of my forum topics? Error: Not unique table/alias: 'forums' <div align="center"> <div align="center"> <table width="57%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FFCC99"><div align="left"> <table width="57%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style2"> <td width="89"><div align="center" class="style3 style4"><strong>Home</strong></div></td> <td width="89"><div align="center" class="style6"><a href="user/index.php?mode=signup" class="style6">Register</a></div></td> <td width="89"><div align="center" class="style6">Memberlist</div></td> <td width="89"><div align="center" class="style6">Search</div></td> </tr> </table> </div></td> </tr> </table> <a href="index.php">Metaldog Forums</a> / <?php $id=$_GET['id']; $mysql= "SELECT * FROM forums WHERE id='$id'"; $result1=mysql_query($mysql); $result=mysql_fetch_array($result1); echo $result['forum_name']; ?> <br> <table width="57%" border="0" cellpadding="0" cellspacing="3" id="1"> <tr> <td><div align="center" class="style1 style2"> </div></td> </tr> <tr> <td><?php $id=$_GET['id']; $result=mysql_query("SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . '<br>' . '<hr> ';} ?></td> </tr> </table> <p> <?php echo $username; ?><br> <br> <span class="style7"><span class="style1">Powered by <a href="index.php">MetalDog.com</a>™ 2007-2008<br> OpenSource Softwares <br> </span><br> </span></p> </div> </div> Quote Link to comment Share on other sites More sharing options...
simon551 Posted July 11, 2007 Share Posted July 11, 2007 what's your forum software? Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 11, 2007 Author Share Posted July 11, 2007 I made the forum myself. I removed the php code I wrote just recently, and it seems to be an html issue...or not. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 11, 2007 Share Posted July 11, 2007 i think that is an sql issue may you plss post that code Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 11, 2007 Author Share Posted July 11, 2007 i think that is an sql issue may you plss post that code Sorry about that, This is the code without the CSS style and Document Title: <div align="center"> <div align="center"> <table width="57%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FFCC99"><div align="left"> <table width="57%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style2"> <td width="89"><div align="center" class="style3 style4"><strong>Home</strong></div></td> <td width="89"><div align="center" class="style6"><a href="user/index.php?mode=signup" class="style6">Register</a></div></td> <td width="89"><div align="center" class="style6">Memberlist</div></td> <td width="89"><div align="center" class="style6">Search</div></td> </tr> </table> </div></td> </tr> </table> <a href="index.php">Metaldog Forums</a> / <?php $id=$_GET['id']; $mysql= "SELECT * FROM forums WHERE id='$id'"; $result1=mysql_query($mysql); $result=mysql_fetch_array($result1); echo $result['forum_name']; ?> <br> <table width="57%" border="0" cellpadding="0" cellspacing="3" id="1"> <tr> <td><div align="center" class="style1 style2"> </div></td> </tr> <tr> <td><?php $id=$_GET['id']; $result=mysql_query("SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . '<br>' . '<hr> ';} ?></td> </tr> </table> <p> <?php echo $username; ?><br> <br> <span class="style7"><span class="style1">Powered by <a href="index.php">MetalDog.com</a>™ 2007-2008<br> OpenSource Softwares <br> </span><br> </span></p> </div> </div> Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 11, 2007 Share Posted July 11, 2007 got cha SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id' you are joining forum from forum that should another table Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 11, 2007 Author Share Posted July 11, 2007 got cha SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id' you are joining forum from forum that should another table THANKYOU again... Now when I click the Forum Name it takes me to the page and displays all the records by pagination, and shows the user what page they are on. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 11, 2007 Share Posted July 11, 2007 so if i solve your prob them mark this solved please Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 11, 2007 Author Share Posted July 11, 2007 so if i solve your prob them mark this solved please I am new here, so solve this one for me too... How do you mark it solved? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 11, 2007 Share Posted July 11, 2007 read http://www.phpfreaks.com/forums/index.php/topic,118758.0.html 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.