Dengan asumsi semua yang Anda coba lakukan adalah menggemakan baris ini menjadi dropdown:
$sql = "SELECT quali_code, title FROM `qualifications` ORDER BY title ";
$result = mysql_query($sql, $this->connection);
while($r=mysql_fetch_array($result))
{
$quali_code = $r['quali_code'];
$result_array[$quali_code][] = $r['title'];
}
echo "<select name='x'>";
foreach($result_array as $q_code => $value)
{
foreach($value as $title) {
echo "<option value='" . $q_code . "'>" . $title . "</option>";
}
}
echo "</select>";