Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PostgreSQL][PHP]Grupowanie tablicy
-FaUst-
post 3.10.2011, 20:45:25
Post #1





Goście







Witam,
mam sobie taką tablicę:

  1. (
  2.  
  3. [1] => Array
  4. (
  5. [org_id] => 9
  6. [org_name] => bla bla bla
  7. [org_adress] => jakas
  8. [org_postal_code] => 12-234
  9. [org_city] => Poznań
  10. [org_short] => bl
  11. [location_id] => 18
  12. [location_name] => lokacja blaa
  13. [location_adress] => inna 12
  14. [location_postal_code] => 61-234
  15. [location_city] => Poznań
  16. [person_id] => 5
  17. [role] => administrator
  18. [first_name] => Alwin
  19. [last_name] => Wiworka
  20. [email] => alwin@bla.pl
  21. [phone] => 23456674
  22. )
  23.  
  24. [2] => Array
  25. (
  26. [org_id] => 9
  27. [org_name] => bla bla bla
  28. [org_adress] => jakas
  29. [org_postal_code] => 12-234
  30. [org_city] => Poznań
  31. [org_short] => bl
  32. [location_id] => 18
  33. [location_name] => lokacja blaa
  34. [location_adress] => inna 12
  35. [location_postal_code] => 61-234
  36. [location_city] => Poznań
  37. [person_id] => 7
  38. [role] => operator
  39. [first_name] =>Paula
  40. [last_name] => Krowa
  41. [email] => paula@muuu.pl
  42. [phone] => 223455
  43. )
  44.  
  45. )


i chciałbym aby wynik był pogrupowany wg org_id, ewentualnie org_name, tzn:

  1. (
  2. [1] => Array
  3. (
  4. [org_id] => 9
  5. [org_name] => bla bla bla
  6. [org_adress] => jakas
  7. [org_postal_code] => 12-234
  8. [org_city] => Poznań
  9. [org_short] => bl
  10. [location_id] => 18
  11. [location_name] => lokacja blaa
  12. [location_adress] => inna 12
  13. [location_postal_code] => 61-234
  14. [location_city] => Poznań
  15. (
  16. [1]=> Array(
  17. [person_id] => 5
  18. [role] => administrator
  19. [first_name] => Alwin
  20. [last_name] => Wiworka
  21. [email] => alwin@bla.pl
  22. [phone] => 23456674
  23. )
  24. [2]=> Array(
  25. [person_id] => 7
  26. [role] => operator
  27. [first_name] =>Paula
  28. [last_name] => Krowa
  29. [email] => paula@muuu.pl
  30. [phone] => 223455
  31. )
  32. )
Go to the top of the page
+Quote Post

Posty w temacie
- FaUst   [PostgreSQL][PHP]Grupowanie tablicy   3.10.2011, 20:45:25
- - FaUst   Nie wiem czy mogę ale podbijam   17.10.2011, 20:42:35


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 07:14