Frage: Was ist ein Gruppenwechsel?
<?php
$sql = 'SELECT firstname, lastname
FROM persons
ORDER BY lastname, firstname';
$res = mysql_query($sql);
$last = '';
while($person = mysql_fetch_objekt($res))
{
if($last != $person->lastname)
{
echo '<h1>' . $person->lastname . '<h1>';
$last = $person->lastname;
}
echo '<p>' . $person->firstname . '</p>';
}
?>