Jump to content

display data on multiple pages


smileeman2002

Recommended Posts

Hi I am new to PHP ..CFMX convert.

1. I have a simple GB and I want to display the data on multiple page. Like 10-20 per page. This is what I have done so far and it is okay but I have 293 entries so I have one long ugly page.

This is how it looks: http://jupub.com/users2.php

2. Also how can I put a space between each group of entries?


<?php
// Connects to your Database
mysql_connect("localhost", "user", "mypassword") or die(mysql_error());
mysql_select_db("my_database") or die(mysql_error());
$data = mysql_query("SELECT * FROM users")
or die(mysql_error());

Print "<table border=0 cellpadding=0>";
while($info = mysql_fetch_array( $data ))
{

Print "<tr>";
Print "<th>Name:</th> <td>".$info['firstname'] . "</tr> ";
Print "<th>Lastname:</th> <td>".$info['lastname'] . "</tr>";
Print "<th>Location:</th> <td>".$info['location'] . "</tr> ";
Print "<th>Comments:</th> <td>".$info['comments'] . " </tr>";

}
Print "</table>";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>


thx
Link to comment
https://forums.phpfreaks.com/topic/31593-display-data-on-multiple-pages/
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.