Where is the information about the logged-in user stored? Let's assume that is stored in the session in the $_SESSION['loggedin_username']
variable. Now while fetching rows you have to check whether the fetched username equals to the logged-in username. So the code would be something like:
<?php
include('includes/setting.php');
$for=mysql_query('SELECT * FROM commentsss');
while($fores=mysql_fetch_array($for)){
echo "<table width='85%' border='1' align='center'>
<tr>
<td width='126' rowspan='2'><p><strong><br><br><br><br>Username</strong>: ".$fores['username']."</p><strong><br>Email:</strong> <p>".$fores['email']."</p></td>
<td height='121' colspan='2'><h2>Title: ".$fores['heading']."</h2></td>
<td width='126' rowspan='2'>";
// Here you check the username from the database with the logged-in username
// and disply the links if they match
if($fores['username'] == $_SESSION['loggedin_username']) {
echo "<h4><br><br><br><br><br><a href=\"editscommsss.php?post_id=".$fores['post_id']."&heading=".$fores['heading']."\">Edit</a> | <a href=\"deletecommsss.php?post_id=
".$fores['post_id']."&heading=".$fores['heading']."\">Delete</a></h4>";
}
echo "</td></tr>
<tr>
<td height='136' colspan='2'><strong>Comment:</strong><p>".$fores['comment']."</p></td>
</tr>
</table>";
}
?>
I didn't test this piece of code since obviously I do not have enough data. But you get the concept.