Create options for a select box using php

  PHP

Email

$sql = "SELECT distinct(a.employee_id) as 'employee_id', CONCAT(a.first_name,' ', a.middle_name,' ',a.last_name) as employee_name
from employee_information a join master_role_mapping b
on (a.employee_id = b.employee_id)
and b.master_role_auto_id IN ('11','12')
and a.employee_id NOT IN (6,231,12,91,204,349,363,432)
and a.status = 'ACTIVE'
order by a.employee_id";
$result = getResult($sql);
while($row = mysqli_fetch_assoc($result)){
$employee_id = $row["employee_id"];
$employee_name = $row['employee_name'];
$boxHtml .= '<option value="'.$employee_id.'">'.$employee_name.'</option>';
$i++;
}
Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of