Page 1 of 1

[SOLVED] yet another problem for the newbee

Posted: Tue Feb 08, 2005 5:19 pm
by groovster
Hi again!

Well I'm new into PHP and MYSQL, sp i have ran into a new problem.
please please help me.

I have this address book database. In this database i have seperated the contacts into countries.
I want to be able to create a link for each country and the after that to be able to see the contacts.
I'm able to pull the contacts the from the databse.
But when i try to get the links with the countries i get like a 20 links with the same country. How do i limit that to only 1 link for each country.

tHX.

NewBee (Groovster)

Posted: Tue Feb 08, 2005 5:30 pm
by feyd
DISTINCT or GROUP BY

group i think

Posted: Tue Feb 08, 2005 5:49 pm
by groovster
My table look like this:

Country Sweden
Name Johan
Lastname Killing
Phone Storgatan 43
and so on....

On the first page i would like to have that it looks like this but i want the script to get the name of the country. For example:


Your conatcts in:

Sweden
USA
Canada


Do you understand what i mean?
i belive it is by group, right?

Posted: Tue Feb 08, 2005 6:12 pm
by feyd
ability to use either depends a bit on the rest of the query. Group-by is often easier to set up in a usable.

Good

Posted: Wed Feb 09, 2005 4:44 pm
by groovster
Thanks.

You are good dude! :lol:

I'll get back if I see problems.

Once again, thank you!

Regards,
Groovster