Hi Guys I have this script that calls up all data from a table. I am making a guest book..
Can anyone modify this for me or let me know what code to add so I can have an unlimited next and previous button or prev link with all links coming up like:
Previous | 123456789 | Next
Can anyone help pls
thanks
Joe
<?php
$sql_host="localhost";
$sql_username="myiste";
$sql_password="pword";
$sql_db="one";
$db = mysql_connect($sql_host,$sql_username,$sql_password);
mysql_select_db($sql_db,$db);
if ($orderby == 'date'):
$sql = "select from guest_book order by 'date'";
elseif ($orderby == 'author'):
$sql = "select from guest_book order by 'author_name'";
elseif ($orderby == 'heading'):
$sql = "select from guest_book order by 'heading'";
elseif (isset($submit)):
$sql = "select from guest_book where author_name = '$author'";
else:
$sql = "select * from guest_book";
endif;
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
print("<tr><td bgcolor=\"#389CD0\"><b>");
printf("<font color =\"white\" face=\"arial\">%s</b></td></tr></font>\n",
$row["heading"]);
printf("<td>By: <a href=\"mailto:%s\">%s</a>\n",
$row["author_email"], $row["author_name"]);
printf("<br>Posted: %s<hr>\n",
$row["date"]);
printf("%s</td></tr>\n",
$row["body"]);
}
?>