Jump to content

pagination HELP!


Abdi

Recommended Posts

<?php

 

session_start();

 

$per_page = 10;

$query = mysql_query("SELECT * FROM 'bio'");

 

 

echo $pages = mysql_result($pages_query, 0);

 

if ($_SESSION ['username'])

echo "<right>Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Log out</a><br><a href='bio.php'>Post an Ad!</a></right>";

 

 

else

die("You must be logged in!");

 

$connect = mysql_connect("localhost","root","4shizzle");

//connect to server

mysql_select_db("textbooks");

 

//query the database

$query = mysql_query("SELECT * FROM bio");

 

echo "<table border=1 cellpadding=10>

<tr>

<th>Date</th>

<th>Class</th>

<th>Book</th>

<th>Price</th>

<th>Email</th>

</tr>";

 

while($rows = mysql_fetch_array($query)):

 

$class = $rows['class'];

$title = $rows['title'];

$email = $rows['email'];

$price = $rows['price'];

$date = $rows['date'];

$newDate = date("M-d", strtotime($date));

 

echo "<tr>";

echo "<td>" . $newDate . "</td>";

echo "<td>" . $class . "</td>";

echo "<td>" . $title . "</td>";

echo "<td>" . $price . "</td>";

echo "<td>". $email . "</td>";

 

echo "</tr>";

 

 

 

endwhile;

 

 

 

 

?>

Link to comment
https://forums.phpfreaks.com/topic/273380-pagination-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.