psubbiah93@gmail.com

Wednesday, 18 November 2015

Display Comments in Hierarchy using PHP


function get_child($pid){
require 'config/connect.php';
$result="";
$aut_qry=mysqli_query($con,"select * from tblcomments where status=1 and parent='$pid'");

//$result = '';
while($aut_row=mysqli_fetch_array($aut_qry,MYSQL_ASSOC)){
$result=$result.$aut_row['comment'].'<br>';
}

//$result=$result.'</select>';

return $result;
}


function get_comment(){
require 'config/connect.php';
$result="";
$aut_qry=mysqli_query($con,"select * from tblcomments where status=1 and parent=''");

//$result = '';
while($aut_row=mysqli_fetch_array($aut_qry,MYSQL_ASSOC)){
$result=$result.$aut_row['comment'].'<br>';
$result=$result.'&nbsp;&nbsp;&nbsp'.get_child($aut_row['id']);
}

//$result=$result.'</select>';

return $result;
}
Unknown Web Developer

Hello! I am Subbiah P and this is my web technologies blog. My specialities are PHP, Asp.net, jQuery, and CMS web application development. I do accept paid work. Write to me to start working on your dream project . I am Working as Web developer in Peace Soft Technologies

No comments:

Post a Comment