Hi !
I'm making some sort of forum...
i want to make a html table with the message of the sender and beneath that message the reply's but i cant show the reply...
i've got a table with the fields:
naam, id, parentid, tekst...
can someone help me....i think the problem is withing the $query2 variable..see below for the source...Thanx!
<?php
// verbinden met database
mysql_connect("localhost","","") or die ("lukt niet verbinden");
// database selecteren
mysql_select_db("message") or die ("lukt niet selecteren");
// eerste query om onderwerp en naam van bericht met parentid o te selecteren
$query="select from message where parentid=0";
$query2="select from message where parentid=id";
// eerste query in result zetten
$result=mysql_query($query);
$result2 = mysql_query($query2);
print "<table align=center bgcolor=a9a9a9 width=700 border=0 cellspacing=0 cellpadding=1>";
print "<tr><td>";
// loop voor het zoeken naar onderwerp en naam met parent id o
while ($a_row = mysql_fetch_array ( $result))
{
// tabel voor witte kleur
print "<table align=center bgcolor=FFFFFF width=700 border=0 cellspacing=0 cellpadding=0>";
print "<tr><td>";
print ("<table align=center bgcolor=FFFFFF width=700 border=0 cellspacing=o cellpadding=0>");
print "<tr><td width=350 bgcolor=e9e9e9><font face=arial size=1>naam: $a_row[naam]</font></td>";
print "<td width=350 bgcolor=e9e9e9><font face=arial size=1>onderwerp: $a_row[onderwerp]</font></td></tr></table>";
print "<table bgcolor=FFFFFF align=center width=700 border=0 cellspacing=0 cellpadding=0>";
print "<tr><td width=700 bgcolor=FFFFFF><font face=arial size=1> $a_row[tekst]</font></td><tr></table>";
print "<table align=center width=700 border=0 cellspacing=0 cellpadding=0>";
print "<tr><td width=700 bgcolor=e9e9e9><font face=arial size=1>[reacties]</font></td></tr></table>";
}
print "</td></tr></table>";
while ($b_row = mysql_fetch_array($result2))
{
print "<table align=center width=700 bgcolor=FFFFFF cellspacing=0 cellpadding=0><tr>";
print "<td width=350><font face=arial size=1><a href=reply.php?id=$b_row[id]>$b_row[onderwerp]</font>";
}
print "</td></tr></table>";
?>