Ungetestet, aber vielleicht lässt sich was draus machen:
PHP-Code:
$sql = "SELECT * FROM " . $db;
$abfrage = mysql_query($sql);
if(mysql_num_rows($abfrage)) {
while($row = mysql_fetch_assoc($abfrage)) {
$first[] = str_rot13($row['teil1']);
$second[] = str_rot13($row['teil2']);
}
}
$my_temp = array_flip($first);
ksort($my_temp);
foreach ($my_temp as $k)
{
$my_first[] = $first[$k];
$my_second[] = $second[$k];
}
HTH
~