<?php

//fetch.php

include("database_connection.php");

$query = "SELECT * FROM tbl_admin";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$total_row = $statement->rowCount();
$output = '
<select class="form-control" name="employee_id" id="employee_id" required>
';
if($total_row > 0)
{
	foreach($result as $row)
	{
		$output .= '		
		<option value="'.$row["admin_id"].'">'.$row["userName"].'</option>
		';
	}
}
else
{
	$output .= '
	<option value="0">No Data</option>
	';
}
$output .= '</select>';
echo $output;
?>