Forum Moderators: coopster
The code is:-
<p><?php
$server = "localhost"; // server to connect to.
$database = "dbdbdb"; // the name of the database.
$db_user = "dddd"; // mysql username to access the database with.
$db_pass = "pppp"; // mysql password to access the database with.
$table = "alumni"; // the table that this script will set up and use.
$rows = 20; // the number of table rows to display
//
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Can't connect" .mysql_error());
//
mysql_select_db($database)
or die ("Can't connect" .mysql_error());
//
$sql="SELECT fullnames, company, address, email FROM $table";
// open the table and print a header row.
echo "<table align=center width=500>";
echo "<tr bgcolor='#FAC88B' class='NiceSmallBold' style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'><th>Full Names</th><th>Company</th><th>Address</th><th>E-mail</th></tr>\n";
if ($result=mysql_query($sql)) {
while ($row=mysql_fetch_row($result)) {
echo "<tr bgcolor='#FDE9D0'><td style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'>".$row[0]."</td>";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'><p align='center'>".$row[1]."</td>";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'><p align='center'>".$row[2]."</td>";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'><p align='center'>".$row[3]."</td></tr>\n";
}
} else {
echo "<!-- SQL Error ".mysql_error()." -->";
}
echo "</table>";
// close database connection
include("closedb.php");
?></p>
-----------------------------------
Thanks ALL
offsetargument which would allow you to tell it where to start (aids in paging forward and backward).