Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]stronicowanie szukam jakiegoś działającego !
GryFF
post
Post #1





Grupa: Zarejestrowani
Postów: 93
Pomógł: 0
Dołączył: 3.10.2011

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


W necie jest tego pełno ale żadne nie działało mi poprawnie tzn strony się mieszały i td więc mam do was prośbę o danie jakiegoś sprawdzonego stronicowania którego sami używacie, za każdą odp daje +
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Ruch Radzionków
post
Post #2





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

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


  1. define('MAXPAGE', 25);
  2. $pok = mysql_query("SELECT COUNT(*) FROM users ORDER BY id");
  3. list($max) = mysql_fetch_row($pok);
  4. $total = ceil($max / MAXPAGE);
  5. $page = intval(@$_GET["page"]);
  6. if(0 == $page)
  7. {
  8. $page = 1;
  9. }
  10. $start = MAXPAGE * ($page - 1);
  11. $full = MAXPAGE;
  12. $obej = mysql_query("SELECT * FROM users ORDER BY id limit $start, $full");
  13. while(list($id, $login, $haslo, $mail, $status, $langs, $data, $admin, $oficjalne) = mysql_fetch_row($obej))
  14. {
  15. //dany text
  16. }
  17. if($_GET[page] == '')
  18. {
  19. $strona = '1';
  20. }
  21. else
  22. {
  23. $strona = $_GET[page];
  24. }
  25. $poprzedniastrona = $_GET[page] - 1;
  26. if($_GET[page] == '')
  27. {
  28. $nastepnastrona = '2';
  29. }
  30. else
  31. {
  32. $nastepnastrona = $_GET[page] + 1;
  33. }
  34. echo'</table>';
  35. if($total == '0')
  36. {
  37.  
  38. }
  39. else
  40. {
  41. echo'<table align="center">
  42. <tr>
  43. <td>';
  44. if(($_GET[page] == '1') || ($_GET[page] == ''))
  45. {
  46. }
  47. else
  48. {
  49. echo'<a href="index.php?event=users&page=1"><input type="submit" value="'.$lang[pierwszastronakatalog].'"></a><a href="index.php?event=users&page='.$poprzedniastrona.'"><input type="submit" value="'.$lang[poprzedniastronakatalog].'"></a>';
  50. }
  51. echo $lang[stronakatalog]; echo $strona; echo $lang[zkatalog]; echo $total;
  52. if($strona == $total)
  53. {
  54.  
  55. }
  56. else
  57. {
  58. echo'<a href="index.php?event=users&page='.$nastepnastrona.'"><input type="submit" value="'.$lang[nastepnastronakatalog].'"></a><a href="index.php?event=users&page='.$total.'"><input type="submit" value="'.$lang[ostatniastronakatalog].'"></a>';
  59. }
  60. echo'</td>
  61. </tr>
  62. </table>';
  63. }
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.10.2025 - 15:31