Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [SQL]Trzy zapytania dające jeden wynik
eurosoft
post 12.11.2010, 13:40:08
Post #1





Grupa: Zarejestrowani
Postów: 179
Pomógł: 0
Dołączył: 5.11.2010

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


Mam poniższe zapytania, czy istnieje sposób na pokazanie wyniku w tabeli imie_nazwisko | suma ilości?
  1. $sql1 = "SELECT
  2. $tabela.id_book,
  3. $tabela.imie_nazwisko,
  4. $tabela1.animals,
  5. $tabela1.ilosc
  6. FROM book LEFT JOIN shot ON book.id_book=shot.id_book where shot.animals='małpa' ORDER BY $tabela1.ilosc";
  7. $result1 = mysql_query($sql1) OR die('Queryproblem: '.mysql_error());
  8.  
  9. $sql2 = "SELECT
  10. $tabela.id_book,
  11. $tabela.imie_nazwisko,
  12. $tabela1.animals1,
  13. $tabela1.ilosc1
  14. FROM book LEFT JOIN shot ON book.id_book=shot.id_book where shot.animals1='małpa' ORDER BY $tabela1.ilosc1";
  15. $result2 = mysql_query($sql2) OR die('Queryproblem: '.mysql_error());
  16.  
  17. $sql3 = "SELECT
  18. $tabela.id_book,
  19. $tabela.imie_nazwisko,
  20. $tabela1.animals2,
  21. $tabela1.ilosc2
  22. FROM book LEFT JOIN shot ON book.id_book=shot.id_book where shot.animals2='małpa' ORDER BY $tabela1.ilosc2";
  23. $result3 = mysql_query($sql3) OR die('Queryproblem: '.mysql_error());
  24.  
  25.  
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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 17:27