Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> najnowsze pola z kilku tabel
--kurak--
post 6.11.2007, 02:25:47
Post #1





Goście







Jak pobrac dane z bazy, z 2 tablic o takich samych nazwach pol,
Moj problem jest opisany tutaj http://algorytmy.pl/?id=2164 ale nie ma rozwiazania :/
moje tabele:
  1. CREATE TABLE `mixtape` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `artist` text NOT NULL,
  4. `album` text NOT NULL,
  5. `tracklista` text NOT NULL,
  6. `opis` text NOT NULL,
  7. `url` text NOT NULL,
  8. `img` text NOT NULL,
  9. `vip` int(8) NOT NULL DEFAULT '0',
  10. `data` text NOT NULL,
  11. `ocena` int(11) NOT NULL DEFAULT '0',
  12. `ile_ocen` int(11) NOT NULL DEFAULT '0',
  13. PRIMARY KEY (`id`)
  14. ) TYPE=MyISAM AUTO_INCREMENT=16 ;
  15.  
  16.  
  17.  
  18. CREATE TABLE `plyty` (
  19. `id` int(11) NOT NULL AUTO_INCREMENT,
  20. `artist` text NOT NULL,
  21. `album` text NOT NULL,
  22. `tracklista` text NOT NULL,
  23. `opis` text NOT NULL,
  24. `url` text NOT NULL,
  25. `img` text NOT NULL,
  26. `vip` int(8) NOT NULL DEFAULT '0',
  27. `data` text NOT NULL,
  28. `ocena` text NOT NULL,
  29. `ile_ocen` int(11) NOT NULL DEFAULT '0',
  30. PRIMARY KEY (`id`)
  31. ) TYPE=MyISAM AUTO_INCREMENT=18 ;

chce z tych tabel wyciagnac pola id, artist, album a potem je zapetlic i posortowac wedlug daty malejąco
Czy ktos moze napisac jak to zrobic ?
z gory thx... p0zdro
Go to the top of the page
+Quote Post
Darti
post 6.11.2007, 02:45:10
Post #2





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

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


  1. (SELECT `id`,`artist`,`album`,`data` FROM `mixtape`) UNION
  2. (SELECT `id`,`artist`,`album`,`data` FROM `plyty`) ORDER BY `data` DESC


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post

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: 31.07.2025 - 10:49