Jump to content

[SOLVED] Not a Unique Table


phpSensei

Recommended Posts

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>&#8482; 2007-2008<br>
      OpenSource Softwares <br>  
        </span><br>
    </span></p>
  </div>

</div>

Link to comment
Share on other sites

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>&#8482; 2007-2008<br>
      OpenSource Softwares <br>  
        </span><br>
    </span></p>
  </div>

</div>

Link to comment
Share on other sites

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