hi
i'm beginner in PHP.I;ve used paging in my web application.
i am using html tables with background images to dispaly data from database.
the paging works properly.But the images get displayed only on first page.
on rest of the pages images are missing.
here is the sample code
while($row=mysql_fetch_array($result,MYSQL_ASSOC))
{
?>
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr> <TD width=9><IMG height=22
src="images/pro_info_top_left.gif"
width=9></TD><TD
background=images/pro_info_top_bg.gif colspan="4"></TD><TD width=9><IMG height=22
src="images/pro_info_top_right.gif"
width=9></TD></tr>
<tr><TD
background=images/pro_info_left_bg.gif></TD>
<td><table border="0" cellpadding="0" cellspacing="0" width="50% style="border-collapse:collapse" >
<tr><td colspan="2"></td><td align="right"><a href="EditStaff.php?Name1=<?PHP echo $row['Name']; ?>" >view</a></td></tr>
<tr><td rowspan="4"><input type="image" src="./upload/<?PHP echo $row['Name']; ?>.jpeg" Width="80" Height="100"></td><td>Name:</td><td><?PHP echo $row['Name']; ?></td></tr>
<tr><td>Department:</td><td><?PHP echo $row['Department']; ?></td></tr>
<tr><td>Designation:</td><td><?PHP echo $row['Designation']; ?></td></tr>
<tr><td>Email:</td><td><?PHP echo $row['Email']; ?></td></tr>
</table></td>
<TD background=images/pro_info_right_bg.gif></TD></tr>
<TR>
<TD><IMG height=21 src="images/pro_info_bottom_left.gif" width=9></TD>
<TD background=images/pro_info_bottom_bg.gif colspan="4"></TD>
<TD><IMG height=21
src="images/pro_info_bottom_right.gif"
width=9></TD>
</TR>
<tr><td colspan="3"></td></tr>
</table>
<?PHP
}
$query = "SELECT COUNT(*) AS numrows FROM Faculty";
$result = mysql_query($query) or die('Error, query2 failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
echo $numrows;
// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);
// print the link to access each page
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?page=$page\">$page</a> ";
}
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?page=$page\">[Prev]</a> ";
$first = " <a href=\"$self?page=1\">[First Page]</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?page=$page\">[Next]</a> ";
$last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo $first . $prev .
" Showing page $pageNum of $maxPage pages " . $next . $last;
include "closedb.php";
?>
can anybody help me