prepare("insert into educresponses (responseid,responsetitle,response,timepost,userid,responsesid) values ('','$title','$response',now(),'$id','$pid')"); $pidsql->execute(); } if (isset($rid)) { $title = addslashes($_POST['title']); $response = addslashes($_POST['response']); $ridsql = $dbh->prepare("insert into educresponses (responseid,responsetitle,response,timepost,userid,responsesid) values ('$rid','$title','$response',now(),'$id','')"); $ridsql->execute(); } ?> String of Knowledge prepare("select educresponses.id,educresponses.responsetitle, educresponses.response, date_format(educresponses.timepost,'%M %D, %Y %h:%i:%s %p'), educusers.username from educresponses, educusers where educusers.id = educresponses.userid and educresponses.responsesid = '$subid'"); $subsql->execute(); $num = 0; while ($numrow = $subsql->fetch()){ $num++; } if ($num> 0) { while ($subrow = $subsql->fetch()) { $subsubid = $subrow[0]; $subtitle = $subrow[1]; $subresponse = $subrow[2]; $subtimeresponse = $subrow[3]; $subresusername = $subrow[4]; //if the $id is in the readby field, this should not be bold. $subarray = explode(",",$subresreadby); $subsingleline = ""; echo ''; $subrestofpost = "
".$subresponse."

Posted by ".$subresusername." at ".$subtimeresponse."
Respond
"; $bold = 'bold'; foreach ($subarray as $subkey => $subvalue) { if ($id == $subvalue) $bold = 'normal'; } $subresponse = $subsingleline."".$subtitle."".$tabs.$tabs.$subrestofpost; $sublink = $tabs.$tabs.$subresponse; echo '
'; echo $sublink; echo ""; $bold = 'bold'; recurseme($subsubid,$level); } } } $sql = $dbh->prepare("select educresponse.id,educresponse.initresponse, date_format(educresponse.timepost,'%M %D, %Y %h:%i:%s %p'), educusers.username from educresponse, educusers where educusers.id = educresponse.userid"); $sql->execute(); while ($row = $sql->fetch()) { $rid = $row[0]; $statement = $row[1]; $timeofpost = $row[2]; $username = $row[3]; echo "

".$statement."

"; echo ''; echo "
Respond


"; echo ""; echo "Posted by ".$username." at ".$timeofpost; echo '
'; $innersql = $dbh->prepare("select educresponses.id,educresponses.responsetitle, educresponses.response, educresponses.timepost, educusers.username from educresponses, educusers where educusers.id = educresponses.userid and educresponses.responseid = '$rid' and educresponses.responsesid = ''"); $innersql->execute(); while ($innerrow = $innersql->fetch()) { $response = ''; $singleline = ''; $restofpost = ''; $subid = $innerrow[0]; $title = $innerrow[1]; $response = $innerrow[2]; $timeresponse = $innerrow[3]; $resusername = $innerrow[4]; $array = explode(",",$resreadby); $singleline = ""; echo ''; $restofpost = "
".$response."

Posted by ".$resusername." 'at ".$timeresponse."
Respond
"; $resusername = $innerrow[4]; $bold = 'bold'; foreach ($array as $key => $value) { if ($id == $value) $bold = 'normal'; } $response = $singleline."".$title."".$restofpost; $link = $tabs.$response; echo '
'; echo $link; echo ""; recurseme($subid,1); } echo '


'; //response to responses } ?>