Hi Guys,
How can i make the following php page goto the next row from the database when they click on the "Next Page" link? At the moment it just adds 1 to the $rowstart=0 value. I need it to be able to goto the next available row.
Any help greatly appreciated.
<?
include ("config.php");
if(!$rowstart) $rowstart=0;
$query = "SELECT * FROM biography, artist WHERE biography.artist_id=artist.artist_id AND biography.bio_id=$id limit $rowstart,1";
$result2 = mysql_query("select * from biography");
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$medium = nl2br($row['medium']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0056)[url]http://www.devilsdivine.com.au/gallery_adamiriti_001.htm[/url] -->
<HTML><HEAD><TITLE>Adam Oriti - Bleeding Gold2</TITLE>
<META content=index,follow name=robots><LINK href="stylesheet.css" rel=stylesheet type=text/css>
<SCRIPT language=javascript src="java.js" type=text/javascript></SCRIPT>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content=en-au http-equiv=Content-Language>
<META content=www.ripefruit.com.au name=author>
<META content=webmaster@ripefruit.com.au name=reply-to>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY background="images/bg_secret_rose.gif"
bgColor=#000000 text=#c0c0c0>
<DIV align=center>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD width="100%">
<P align=right><A href="http://www.devilsdivine.com.au/index.htm"><IMG
alt=www.devilsdivine.com.au border=0 height=50
src="images/logo_dd3.gif"
width=350></A></P></TD></TR></TBODY></TABLE></DIV>
<DIV align=center>
<CENTER>
<TABLE bgColor=#000000 border=3 borderColor=#808080 cellPadding=10 height="85%"
width=760>
<TBODY>
<TR></CENTER>
<TD width="33%">
<TABLE border=0 cellPadding=0 cellSpacing=0 height="100%" width="100%">
<TBODY>
<TR>
<TD align=left rowSpan=2 vAlign=top width=605>
<TABLE border=0 cellPadding=15 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD width="100%">
<TABLE border=0 cellPadding=5 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD width="360">
<P align=center><IMG alt=www.devilsdivine.com.au border=0 width=360 src="images/<? echo "{$row['art_pic']}"?>"></P></TD>
<TD width="121" valign="top">
<P><FONT color=#808080>Title:</FONT> <FONT
color=#ffffff><? echo "{$row['title']}"?></FONT></P>
<P><FONT color=#808080>Artist: </FONT><A
href="gallery_details.php?id=<? echo "{$row['artist_id']}"?>"><? echo "{$row['first_name']}"?> <? echo "{$row['surname']}"?></A></P>
<P><FONT color=#808080>Medium: </FONT><? echo $medium?></P>
<P><FONT color=#808080>Size: </FONT><? echo "{$row['size']}"?></P>
<P><FONT color=#808080>Price:</FONT> $AU <? echo "{$row['price']}"?></P>
<P><FONT color=#808080>Contact:</FONT> <A
href="http://www.devilsdivine.com.au/contacts.htm">Here</A> </P></TD></TR>
<TR>
<TD colSpan=2>
<P align=left>
<?
if ($rowstart>$numrows)
{
$id = $rowstart-1;
echo"<A href=\"work_detail.php?id=$id\">Previous Page</A> |";
}
$numrows=mysql_num_rows($result2);
if(($rowstart+1) <$numrows)
{
$id = $rowstart+1;
echo"<A href=\"work_detail.php?id=$id\">Next Page</A>";
}
?>
</P></TD></TR>
<TR>
<TD colSpan=2><!--webbot bot="DIRECTION" WIP="yes" startspan Preview=" <input type=button value="Back to last page" >" i-type="0" s-imageloc="Back to last page" clientside -->
<FORM><INPUT onclick=history.back() type=button value="Back to last page">
</FORM><!--webbot bot="DIRECTION" endspan i-CheckSum="48583" --></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD
background="images/dividere_vert_blue4.gif"
height="200%" rowSpan=2 vAlign=top width=20> </TD>
<TD align=right height="100%" vAlign=top><!--webbot bot="Include" U-Include="navr.htm" TAG="BODY" startspan -->
<DIV align=right>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=175>
<TBODY>
<TR>
<TD height=30>
<P align=right><A
href="http://www.devilsdivine.com.au/gallery.htm">Gallery</A></P></TD>
<TD align=middle height=30 width=30><IMG border=0 height=20
src="images/dd_symbol.gif"
width=17> </TD></TR>
<TR>
<TD height=30>
<P align=right><A
href="http://www.devilsdivine.com.au/contacts.htm">Contact
Us</A></P></TD>
<TD align=middle height=30 width=30><IMG border=0 height=20
src="images/dd_symbol.gif"
width=17> </TD></TR>
<TR>
<TD height=30>
<P align=right><A
href="http://www.devilsdivine.com.au/home.htm">Home</A>
</P></TD>
<TD align=middle height=30 width=30><IMG border=0 height=20
src="images/dd_symbol.gif"
width=17> </TD></TR>
<TR>
<TD height=30></TD>
<TD align=middle height=30 width=30><IMG border=0 height=10
src="images/spacer.gif" width=10>
</TD></TR></TBODY></TABLE></DIV>
<TABLE>
<TBODY>
<TR>
</TR></TBODY></TABLE>
<P align=right> </P></TD></TR>
<TR>
<TD align=right height="100%" vAlign=bottom>
<P align=right><IMG alt="Home Page" border=0 height=22
src="images/side_artist.gif"
width=131></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></BODY></HTML>
<?
}
?>