Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zapytanie do jednej tabeli na podstawie innej
krysk
post
Post #1





Grupa: Zarejestrowani
Postów: 146
Pomógł: 0
Dołączył: 20.04.2002
Skąd: Szczecin

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


Mam dwie tabele - fud2_users oraz fud2_shot. Chciałbym pobrać całą zawartość tabeli fud2_shout oraz z tabeli fud2_users nick użytkownika na podstawie id - jest to możliwe w jednym zapytaniu? Jak to później odebrać w php - zwykłe mysql_fetch_array()?


Wymyśliłem takie zapytanie:
  1. SELECT `fud2_shout.*`, `fud2_users.id`, `fud2_users.login` FROM `fud2_shout`, `fud2_users` WHERE `fud2_users.id`=`fud2_shout.rid` ORDER BY `time` DESC LIMIT 10


ale niestety ono coś nie bangla :|
Go to the top of the page
+Quote Post
blind fish
post
Post #2





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 7.08.2004

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


Ja mam podobny problem, czy ktoś mógłby poradzić co się dzieje i ew. jak sobie z tym problemem poradzić?
Go to the top of the page
+Quote Post
krysk
post
Post #3





Grupa: Zarejestrowani
Postów: 146
Pomógł: 0
Dołączył: 20.04.2002
Skąd: Szczecin

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


napisałem poprawne zapytanie, może Ci pomoże:

  1. SELECT fud2_shout.*, fud2_users.id, fud2_users.login FROM `fud2_shout`, `fud2_users` WHERE fud2_users.id=fud2_shout.rid ORDER BY time LIMIT $num1, $num
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 23.08.2025 - 10:01