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> Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/ Share on other sites More sharing options...
simon551 Posted July 11, 2007 Share Posted July 11, 2007 what's your forum software? Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295850 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. Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295853 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 Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295854 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> Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295855 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 Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295857 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. Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295860 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 Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295862 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? Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295867 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 Link to comment https://forums.phpfreaks.com/topic/59542-solved-not-a-unique-table/#findComment-295869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.