I'm trying to set up a message board style display that relies on parent child ids in a mysql table. The problem I am having is that I can get the first child to indent, but I can't figure out how to get subsequent child ids to continue to indent after the first one. My guess is that it requires a second for or while loop to loop out the child ids, but I havn't been able to get it to work yet. Here's the code:
$sqlMessage = "SELECT adminId,adminPrimaryId,admintitle,adminUserId,DATE_FORMAT(submitDate,'%W %c/%e, %l:%i %p') as SubmitDate
FROM database.table";
$sqlViewMessage = mysql_query($sqlMessage);
while($messagerow = mysql_fetch_array($sqlViewMessage)){
$primaryId=$messagerow["adminId"];
$secondaryId=$messagerow["adminPrimaryId"];
if($primaryId=$secondaryId){
print(" >>");
}else{
print("");
}
echo ("<a href=\"page.php?message=" . $messagerow["adminId"] ."\">" .
$messagerow["admintitle"] . "</a> - from " . $messagerow["adminUserId"] ." on " . $messagerow["SubmitDate"] . "<br>");
}