List Info

Thread: Sorting MySQL into categories with loops




Sorting MySQL into categories with loops
country flaguser name
United States
2007-06-14 14:39:12
Sorry if this has been asked many times before - couldn't
find with a
bunch of searching...

I have one MySQL table (called 'markers') with a list of
cities and
place names. I want to be able to list all of my places, and
have them
sorted by city, eg:

Calgary (city)
-- Place 1 (place)
-- Place 2
-- Place 3
Edmonton
-- Place 1
-- Place 2
-- Place 3

I figured I can do it with 2 queries within 2 loops, but I
figure
there must be a more "proper" way and I'd like to
learn how.

Can anyone give me some guidance? Thanks in advance.


--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the
Google Groups "Professional PHP Developers"
group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---


Re: Sorting MySQL into categories with loops
user name
2007-06-15 00:34:51
sorry, I did not understand exactly what do you want to do more this would not be a simple one select????

On 6/14/07, Adam < stylesgmail.com"> stylesgmail.com> wrote:

Sorry if this has been asked many times before - couldn';t find with a
bunch of searching...

I have one MySQL table (called 'markers') with a list of cities and
place names. I want to be able to list all of my places, and have them
sorted by city, eg:

Calgary (city)
-- Place 1 (place)
-- Place 2
-- Place 3
Edmonton
-- Place 1
-- Place 2
-- Place 3

I figured I can do it with 2 queries within 2 loops, but I figure
there must be a more "proper" way and I'd like to learn how.

Can anyone give me some guidance? Thanks in advance.







--
Sem mais para o momento,
Rodrigo Souza

--------------------------------------------------------------------------------
:: Rodrigo Souza dos Santos
:: Curitiba - Paraná - Brasil
:: rodrigosouzadossantosgmail.com">rodrigosouzadossantosgmail.com
--------------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

Re: Sorting MySQL into categories with loops
user name
2007-06-15 00:40:12
I forgot, the return would be a vetor and you would list that with foreach()

On 6/15/07, Rodrigo Souza < rodrigosouzadossantosgmail.com"> rodrigosouzadossantosgmail.com> wrote:
sorry, I did not understand exactly what do you want to do more this would not be a simple one select????


On 6/14/07, Adam < stylesgmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> stylesgmail.com> wrote:

Sorry if this has been asked many times before - couldn';t find with a
bunch of searching...

I have one MySQL table (called 'markers') with a list of cities and
place names. I want to be able to list all of my places, and have them
sorted by city, eg:

Calgary (city)
-- Place 1 (place)
-- Place 2
-- Place 3
Edmonton
-- Place 1
-- Place 2
-- Place 3

I figured I can do it with 2 queries within 2 loops, but I figure
there must be a more "proper" way and I'd like to learn how.

Can anyone give me some guidance? Thanks in advance.







--
Sem mais para o momento,
Rodrigo Souza

--------------------------------------------------------------------------------
:: Rodrigo Souza dos Santos
:: Curitiba - Paraná - Brasil
:: rodrigosouzadossantosgmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rodrigosouzadossantosgmail.com
--------------------------------------------------------------------------------



--
Sem mais para o momento,
Rodrigo Souza

--------------------------------------------------------------------------------
:: Rodrigo Souza dos Santos
:: Curitiba - Paraná - Brasil
:: rodrigosouzadossantosgmail.com">rodrigosouzadossantosgmail.com
--------------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )