Witam,
Mam problem z modyfikacja poniższego zapytania
  1. SELECT DISTINCT machines.name
  2. , locations.name
  3. FROM
  4. game_locations
  5. INNER JOIN game_location_machines
  6. ON game_locations.id = game_location_machines.game_location_id
  7. INNER JOIN locations
  8. ON game_locations.location_id = locations.id
  9. INNER JOIN machines
  10. ON game_location_machines.machine_id = machines.id
  11. WHERE
  12. game_locations.game_id = 36
  13. ORDER BY
  14. locations.name

Chciałbym, żeby wszystkie maszyny byly w tablicy lokalizacji a nie pojedynczo
  1. array(
  2. (int) 0 => array(
  3. 'machines' => array(
  4. 'name' => 's3'
  5. ),
  6. 'locations' => array(
  7. 'name' => 'DE - HĂźrth'
  8. )
  9. ),
  10. (int) 1 => array(
  11. 'machines' => array(
  12. 'name' => 's4'
  13. ),
  14. 'locations' => array(
  15. 'name' => 'FR - OVH ROUBAIX 1'
  16. )
  17. ),
  18. (int) 2 => array(
  19. 'machines' => array(
  20. 'name' => 's2'
  21. ),
  22. 'locations' => array(
  23. 'name' => 'PL - ATMAN Warszawa
  24. '
  25. )
  26. ),
  27. (int) 3 => array(
  28. 'machines' => array(
  29. 'name' => 's1'
  30. ),
  31. 'locations' => array(
  32. 'name' => 'PL - ATMAN Warszawa
  33. '
  34. )
  35. )
  36. )