I have a select box which shows job roles.
Upon select I would like another select box to auto populate the department (stored in the same row as job role in the MySQL DB)
<select class="full-width"name="manager" data-placeholder="Manager" data-init-plugin="select2">
<?
$result=mysql_query("SELECT * FROM hr_job_roles")or die('Could not connect:' . mysql_error());
for ($i = 1; $i <= mysql_num_rows($result); $i++)
{
$row = mysql_fetch_array($result);
$title=$row['title'];
echo" <option value='$title'>$title </option>";
}
if ($i % 4 == 0) {
echo ''; // it's time no move to next row
}
?>
</select>