<?php

$conn = @mysqli_connect('localhost', 'root', '');
  if (!$conn)
  {
    die("Database Connection Failed" . mysql_error());
  }

  $select_db = mysqli_select_db($conn,'p2');
  if (!$select_db)
  {
    die("Database Selection Failed" . mysql_error());
  }

 $sql       = 'select * from daily_pay group by emp_id';
 $results   = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($results)) {
$count = $row['count'];
$emp_id = $row['emp_id'];


while ($count < 15){

	$count = $count + 1;
	echo $count;
}

if ($count == 15){
	echo $emp_id;

}

}

?>