Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zapytanie z wielkokrotnym left join
lustfingers
post
Post #1





Grupa: Zarejestrowani
Postów: 99
Pomógł: 5
Dołączył: 18.03.2015

Ostrzeżenie: (0%)
-----


Witam, uczę sie pilnie php i mysql jednak czasami coś mnie przystawi, próbuje z bazy pobrać pewne dane moje zapytanie wygląda tak:

  1. SELECT ps_order_detail.id_order, ps_orders.id_customer, ps_customer.firstname, ps_customer.lastname, ps_customer.email, ps_address.address1, ps_address.address2, ps_address.postcode, ps_address.city, ps_address.phone_mobile
  2. FROM ps_order_detail
  3. WHERE product_id = '18' OR product_id = '19' OR product_id = '20' OR product_id = '21' OR product_id = '45'
  4. LEFT JOIN ps_orders
  5. ON ps_orders.id_order = ps_order_detail.id_order
  6. LEFT JOIN ps_customer
  7. ON ps_customer.id_customer = ps_orders.id_customer
  8. LEFT JOIN ps_address
  9. ON ps_customer.id_customer = ps_address.id_customer
  10. GROUP BY ps_address.id_customer


Otrzymuję komunikat:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN ps_orders
ON ps_orders.id_order = ps_order_detail.id_order
LEFT JOIN ' at line 4

Ktoś mnie może nakierować co robię źle?
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 20.08.2025 - 13:38