<?php
$sql="select * from shop.profile order by shop_city";
$query=mysql_query($sql) or die ("error=$sql");
$row=mysql_fetch_array($query);
echo "$row[shop_city]<br>";
$sql="select * from shop.profile where shop_city=$row[shop_city]";
$query=mysql_query($sql) or die("error=$sql");
while($row=mysql_fetch_array($query)) {
$name=$row[name];
echo"$name";
}
?>