Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Ograniczenie wyników wyświetlanych na stronie
Bitkosa
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 21.10.2009

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


Mam pytanie jak ograniczyć liczbę wyników wyświetlanych na stronie i jak zrobić strony poprzednią i następnąquestionmark.gif Proszę o pomoc

Oto kod

  1. <?
  2.  
  3. $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM movies WHERE dodajacy_id='".$id."'"),0);
  4. if ($total_results <= 0)
  5. {
  6. echo '<br />Użytkownik nie dodał jeszcze żadnego filmu.<br />';
  7. }
  8.  
  9. else
  10. {
  11.  
  12. $sql = mysql_query("SELECT * FROM movies WHERE dodajacy_id='".$id."' ORDER BY id DESC");
  13. while($row = mysql_fetch_array($sql)) {
  14. $content = strip_tags($row['description']);
  15. if (strlen($content) > 65)
  16. {
  17. $content = substr($content, 0, 65)."...";
  18. }
  19. if ($row['import'] == 1) {
  20. $image = '<img align="absmiddle" src="'.$site_url.'/games/images/'.$row['url'].'.png" width="60" height="60" />';}
  21. else if ($row['import'] == 3) {
  22. $image = '<img align="top" src="'.$site_url.'/games/images/'.$row['image'].'" width="60" height="60" />';}
  23. else {
  24. $image = '<img align="absmiddle" src="'.$row['image'].'" width="60" height=60" />';}
  25.  
  26. if ($seo_on == 0) {
  27. $game_url = 'index.php?task=view&id='.$row['id'].'';}
  28. else {
  29. $abcd= $row['name'];
  30. $abcd = str_replace (" ", "-", $abcd);
  31. $abcd = preg_replace ( "/[\.,\";'\:]/", "", $abcd );
  32. $movie_url = 'view/'.$row['id'].'/'.$abcd.'.html';
  33. }
  34. echo '<div style="height:62px; color:#000000; background:#ffffff; margin-left:0px; margin-right:0px; border:0px solid #000000; " align="left"><strong><a href="'.$site_url.'/'.$game_url.'">&nbsp;'.$image.'&nbsp;&nbsp;</a><a href="'.$site_url.'/'.$movie_url.'">'.$row['name'].'</strong></a></div>';}
  35. }
  36.  
  37.  
  38. ?>


--------------------
CYKLINOWANIE PODŁÓG
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: 19.08.2025 - 05:40