I have a small problem. I have two tables in a database:
[place] [client]
id country id name id_place
-------------- ------------------------
1 Canada 1 Mike 1
2 USA 2 Susan 1
3 China 3 Juan 3
4 Nelly 2
5 Kevin 3
Using a SQL query:
SELECT
place.country, cliente.name
FROM
place, client
INNER JOIN
client ON place.id = client.id_place
and I show the results using:
while ($list = mysql_fetch_array($query))
{
echo $list['contry']." | ".$list['name'];
}
And the results are:
Canada | Mike
Canada | Susan
USA | Nelly
China | Juan
China | Kevin
So far so good. My problem is I want to show the results as follows:
<h1> Canada: <h1>
<h3> -Mike <h3>
<h3> -Susan <h3>
<h1> USA: <h1>
<h3> -Nelly <h3>
<h1> China: <h1>
<h3> -Juan <h3>
<h3> -Kevin <h3>
How I can do this? Help me please... Thanks!