I've been having troubles with an Select function. I want it to display a signature a avatar, a poster name and the message, and it only does the poster name and the message. Here's my code:
What's wrong with this? Please help.
Cheers MPCODER
PHP Code:
<?php
/* Maak connection */
$db = mysql_connect("localhost", "user", "pass");
mysql_select_db("db");
/* Read the message */
$sql = "SELECT id, naam, titel, inhoud FROM forum WHERE id='$id'";
$result = mysql_query($sql) or die(mysql_error());
$sql2 = "SELECT avatar, signature, user_name FROM tbl_users WHERE user_name='$row->naam'";
$result2 = mysql_query($sql2) or die(mysql_error());
$row = mysql_fetch_object($result);
$row2 = mysql_fetch_object($result2);
echo "<table width=\"600\" border=\"1\" bordercolor=\"000000\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr>\n";
echo "\t<td>$row2->avatar <br> $row->naam</td>\n";
echo "\t<td>$row->inhoud <br>_____________________<br>$row2->signature</td>\n";
echo "</tr>\n";
echo "</table><p>\n";
echo "<a href='users/newtopic.php?replyto=$id'>Reply</a>";
?>
Cheers MPCODER

Comment