wats roang in here ..
- <?php
- ini_set('display_errors', 1);
- //connecting to database
- $error = "nu am putut sa ma conectez :(";
- mysql_connect('localhost','root','')or die ($error);
- mysql_select_db('dan') or die ($error);
- //max display pet page
- $per_page = 2;
- //get start variabel
- $start = $_GET ;
- //cont record
- $record_count = mysql_num_rows( mysql_query("SELECT *FROM news"));
- //numara numarul maximal a paginilor
- $max_pages = $record_count / $per_pages;
- if (!$start)
- $start = 0 ;
- $get =$record_count = mysql_query("SELECT *FROM news LIMIT $start,$per_page");
- while($row = mysql_fetch_assoc($get))
- {
- //get data
- $id=$row;
- $title = $row;
- $body = $row;
- $date = $row;
- echo"
- <hr><b> <a href='pagina 11,2,3.php?start='>$title</a> $date</b><hr> $body<br/>
- ";
- }
- $prev = $start - $per_page;
- $next = $start + $per_page;
- if (!($start<=0))
- echo"<a href='pagina 11,2,3.php?start=$prev'>Prev</a> ";
- //show page
- //set variable of first page
- $i = 1;
- for ($x=0;$x<$record_count;$x=$x+$per_page)
- {
- if ($start!= $x)
- echo "<a href='pagina 11,2,3.php?start=$x'>$i</a> ";
- else
- echo "<a href='pagina 11,2,3.php?start=$x'><b>$i</b></a> ";
- $i++;
- }
- //show buton
- if (!($start>=$record_count-$per_page))
- echo "<a href='pagina 11,2,3.php?start=$next'>next</a> ";
- ?>
thx 4 help