Paging in php
Posted: Wed Feb 16, 2005 7:41 pm
Warning: extract(): First argument should be an array in /customers/daneshea.com/daneshea.com/httpd.www/functions.php on line 31
This is what I get from the paging script why doesn't it work?
This is what I get from the paging script why doesn't it work?
Code: Select all
if(!$show_from || $show_from < 0) {
$show_from = 0;
}
$pr_page = 20;
$sql = "select ip, id, name, email, message, date_format(time, '%a, %H:%i, %c/%e/%Y') as thetime from tagwall order by time desc limit $show_from, $pr_page";
$result = mysql_query($sql);
$count_amount = "select count(*) as amount from tagwall";
$tag_amountї] = mysql_query($count_amount);
extract($tag_amountї0]);
if($amount > ($show_from + $pr_page)) {
$next_show_from = $show_from + $pr_page;
$next_nav = "<a href="/tagwall.php?show_from=$next_show_from">Next</a>";
}
else {
$next_nav = "<span class="dead-link">Next</span>";
}
if($show_from > 0 && ($show_from - $pr_page) < $amount) {
$prev_show_from = $show_from - $pr_page;
$prev_nav = "<a href="/tagwall.php?show_from=$prev_show_from">Previous</a>";
}
else {
$prev_nav = "<span class="dead-link">Previous</span>";
}
$nav = "<p align="center"><table cellpadding="4">
<tr><td align="center">$prev_nav</td><td align="center">$prev_nav</td></tr>
</p>";
while ($row = mysql_fetch_array($result)) {
extract($row);
?>
<html>
<table cellpadding=2>
<tr><td width=50%>Written By: <? echo "$name"; ?></td></tr>
<tr><td width=50%>Day/Time/Date: <? echo "$thetime"; ?></td></tr>
<tr><td width=50%>Ip: <? echo "$ip"; ?></td></tr>
<tr><td width=50%>Email: <? echo "$email"; ?></td></tr>
<tr><td width=50% height=100 cellpadding=10>Message: <? echo "$message"; ?><br><br><p align=left><span class="class2"><a href="http://www.daneshea.com/<? echo "tagloginconfirm.php?id=$id&action=deleteid"; ?>">Delete</a></span> :: <span class="class2"><a href="http://www.daneshea.com/<? echo "ban.php?deleteid=$id&banip=$ip&name=$name&email=$email"; ?>">Ban</a></span></td></tr></table><br>
</html>
<?
}
echo "$nav";