almost giving up pagination...wanna help?
Posted: Tue Feb 22, 2005 12:35 am
hi there, please read my code below
im stuck here, i tried to search the forum for a good tutorial, i found some, though, but wasn't able to do the same with mine...can't integrate it...i'm very new in php and mysql...maybe anybody out there can help modify this page....it'll be a great help for me.
thanks
pleigh
Code: Select all
<table width="100%" height="100%" border="1" bordercolor="#ffffff" cellpadding="0" cellspacing="0">
<?
$id = $_SESSIONї'userID'];
$query = "SELECT status FROM users WHERE userID='$id' and status='administrator'";
$result = @mysql_query($query);
if ($result)
{
//verify administrator
if ($rowї0])
{
$limit = 10;
$query = "SELECT date, title, postID, firstname FROM posts AS p, users AS u
WHERE p.userID = u.userID ORDER BY date DESC LIMIT $limit";
$result = @mysql_query($query);
if ($result)
{
echo "<tr align=center><td width=20%><table><tr><td><b>NAME</b></td></tr></table></td>
<td width=60%><table><tr><td><b>TOPIC</b></td></tr></table></td>
<td width=20%><table><tr><td><b>DATE</b></td></tr></table></td></tr>";
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$rowї0] = '<font size=-2>'.date("F j, Y, g:i a").'</font>';
echo "<tr><td width=20%><table><tr><td><b><a href="" class="under">$rowї3]</a><b></td></tr></table></td>
<td width=60%><table><tr><td><a href="reportview.php?pid={$rowї2]}" class="under">$rowї1]</a></td></tr></table></td>
<td width=20%><table><tr><td>$rowї0]</td></tr></table></td></tr>";
}
mysql_free_result($result);
echo '<table align="right"><tr><td>Go to page 1,
<a href=report.php?report=$_GETї10] class="under">2, </td></tr></table>';
}
else
{
echo 'system error!<br>'.mysql_error();
}
mysql_close();
}
//if not administrator
else
{
$query = "SELECT date, title, postID FROM posts WHERE userID='$id' ORDER BY date DESC";
$result = @mysql_query($query);
if ($result)
{
echo "<tr align=center><td width=80%><table><tr><td><b>TOPIC</b></td></tr></table></td><td width=20%><table><tr><td><b>DATE</b></td></tr></table></td></tr>";
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
//$post = $rowї2];
echo "<tr><td width=80%><table><tr><td><a href="reportview.php?pid={$rowї2]}" class="under">$rowї1]</td></tr></table></td><td width=20%><table><tr><td>$rowї0]</td></tr></table></td></tr>";
}
mysql_free_result($result);
}
else
{
echo 'system error!<br>'.mysql_error();
}
mysql_close();
}
}
?>
</table>thanks
pleigh