gabi: maxid in array packen und damit neues select starten

Beitrag lesen

Hi Harry,
So sieht die Abfrage jetzt aus, aber es gibt kein Ergebnis?????

$sql="SELECT MAX(id) AS maxid FROM filiale GROUP BY firma";
$result=mysql_query($sql);
$wert=array();
while($row=mysql_fetch_array($result))
{
 $maxid=$row["maxid"];
 $wert[]=$maxid;

}
$sql="SELECT * FROM filiale WHERE id IN('.implode(', ', $wert).')";
$result=mysql_query($sql);