coe is like thsi but it hide child rows of Ist parents only
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Login with jQuery AJAX</title>
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
<script>
$(document).ready(function() {
$('#id1').hide();
});
</script>
</head>
<body>
<?php
$con = mysql_connect("127.0.0.1","root","");
if (!$con)
{
//echo "not Connected";
exit("Connection Failed: " . $con);
}
else
{
echo "Connected";
// Insertion into database
mysql_select_db("directory") or die(mysql_error());
//mysql_query("INSERT INTO products (ProductName) VALUES ('Tabbusamm REcord')")
//or die(mysql_error());
// Insertion into database
$result = mysql_query("select * from topic");
echo "<div>";
echo "<table>
<tr>
<th>topicid</th>
<th>TopicName</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
$topicid = $row['TopicID'] ;
echo "<td>" . $row['TopicID'] . "</td>";
echo "<td>" . $row['TopicName'] ."</td>";
//*************************************************************************
$result1 = mysql_query("select * from comment where topicID = '$topicid' ");
echo "<table id='id1'>";
while($row = mysql_fetch_array($result1))
{
echo "<tr>";
echo "<td>" . $row['TopicID'] . "</td>";
echo "<td>" . $row['Comments'] . "</td>";
echo "</tr>";
}
echo "</table>";
//******************************************************************************
echo "</tr>";
echo "<tr><td></td></tr>";
echo "<tr><td></td></tr>";
}
echo "</table>";
echo "</div>";
mysql_close($con);
}
?>
</body>
</html>
</html>
any help