Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL][PHP] Ostatnia galeria
mrk9109
post 9.08.2011, 13:46:59
Post #1





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

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


Witam otóż mam taki problem pragnę sobie przerobić ostatnią galerie i coś mi nie wychodzi chce aby wyświetlał 3 ostatnie obrazki do danej kategorii . A zamiast tego wyświetlą mi do pierwszej 2 a do pozostałych po 1 dlaczego ? już jestem bezradny i proszę tu o pomoc

  1. <?php
  2.  
  3. $galclass = new Gallery;
  4.  
  5. $_language->read_module('sc_potm');
  6.  
  7. $getGroups = mysql_query("SELECT * FROM ".PREFIX."gallery ORDER BY galleryID LIMIT 3") or die (mysql_error());
  8.  
  9. while($gallery = mysql_fetch_array($getGroups))
  10. {
  11. $images=null;
  12. $image = mysql_query("SELECT * FROM ".PREFIX."gallery_pictures WHERE galleryID='".$gallery['galleryID']."' ORDER BY picID LIMIT 3") or die (mysql_error());
  13. $count = mysql_num_rows($image);
  14. while($pic = mysql_fetch_array($image))
  15. {
  16. $picID = $pic['picID'];
  17. if(file_exists('images/gallery/thumb/'.$picID.'.jpg'))
  18. {
  19. $images .= '<a href="index.php?site=gallery&amp;picID='.$picID.'">
  20. <img src="images/gallery/thumb/'.$picID.'.jpg" width="75" height="80" style="float: left; margin-right: 5px; border: 1px #eeeeee solid; border-radius: 10px;" alt="'.$pic['name'].'" />
  21. </a> ';
  22. }
  23. else
  24. {
  25. $images .= '<a href="index.php?site=gallery&amp;picID='.$picID.'">
  26. <img src="images/nopic.gif" alt="'.$_language->module['no_thumb'].'" />
  27. </a> ';
  28. }
  29. }
  30.  
  31. $galleryID = $gallery['galleryID'];
  32. $name = $gallery['name'];
  33.  
  34. eval ("\$lastgallery = \"".gettemplate("ostatnie_galerie")."\";");
  35. echo $lastgallery;
  36. }
  37.  
  38.  
  39. ?>
  40.  
Go to the top of the page
+Quote Post
CuteOne
post 9.08.2011, 14:04:01
Post #2





Grupa: Zarejestrowani
Postów: 2 958
Pomógł: 574
Dołączył: 23.09.2008
Skąd: wiesz, że tu jestem?

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


1. Sprawdź czy dana galeria na pewno posiada trzy obrazki smile.gif
2. Do zapytań nie dodałeś ASC/DESC za ORDER BY galleryID / ORDER BY picID bo w tym momencie przyjmuje wartość domyślną ASC co może powodować "komplikacje" smile.gif. Więcej o ORDER BY na google

Ten post edytował CuteOne 9.08.2011, 14:06:04
Go to the top of the page
+Quote Post
mrk9109
post 9.08.2011, 14:06:12
Post #3





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

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


problem jest taki że on mi tworze ten cms tylko 2 obrazki o gallery id 1 . Myślałem by zrobić wyświetlanie bo group id to wtedy mam kaszane ;/
Go to the top of the page
+Quote Post
CuteOne
post 9.08.2011, 14:17:24
Post #4





Grupa: Zarejestrowani
Postów: 2 958
Pomógł: 574
Dołączył: 23.09.2008
Skąd: wiesz, że tu jestem?

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


co?
Go to the top of the page
+Quote Post
mrk9109
post 9.08.2011, 17:11:26
Post #5





Grupa: Zarejestrowani
Postów: 445
Pomógł: 3
Dołączył: 4.06.2010

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


nic już poradziłem sobie smile.gif



Ten post edytował mrk9109 9.08.2011, 17:53:12
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: 21.07.2025 - 11:34