Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL] Dane z 2 tabel
Micchaleq
post
Post #1





Grupa: Zarejestrowani
Postów: 186
Pomógł: 4
Dołączył: 13.10.2009

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


Witam serdecznie,

Mam 2 tabele :

1 users :
-user_id
-username
-user_password

2. user_groups
-group_id
-user_id

chcę wyświetlić wszystkie group_id dla danego użytkownika:

Próbowałem tak :
  1. $sql = "SELECT u.username, u.user_password, ug.user_id, g.group_id from ".USERS_TABLE." u, left join ".USERS_GROUPS_TABLE." g WHERE u.username = '".$username."' AND u.user_id = g.user_id";


Ktoś pomoże?


--------------------
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: 22.08.2025 - 03:01