Ename Sal
tom 100
tom 200
bill 100
bill 250
bill 450
bill 400
This is the query and html structure which has given the
You can check condition like this with the last row and the current row.
$sql = "select * from emp";
$result= mysql_query($sql);
echo "";
while($row=mysql_fetch_array($result))
{
$now=$row[0];
if($last!=$now) {
echo "$row['ename'] $row['esal'] ";
}else{
echo " $row['esal'] ";
}
$last = $row[0];
}
echo "
";
I hope this will help you.