Next link by ID
Posted: Wed Mar 29, 2006 1:57 pm
Could someone please help explain the process for creating a"next" link that just jumps to the id in my DB.
The code below is for an image portfolio. This portion of the code is the result when clicking on a thumbnail. So, how would I create a "next" button to show the next item in the portfolio?
Thank you in advance.
The code below is for an image portfolio. This portion of the code is the result when clicking on a thumbnail. So, how would I create a "next" button to show the next item in the portfolio?
Thank you in advance.
Code: Select all
...previous code
else {
$query = "SELECT * FROM port WHERE id=".$_GET['id'];
$result = mysql_query($query) or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$title = $row['title'];
$category = $row['category'];
$description = $row['description'];
$url = $row['url'];
$path = $row['path'];
$content .= "<table cellpadding=0 cellspacing=0 width=370 height=373>
<tr valign=middle>
<td width=370 bgcolor=#ffffff>
<p align=center><img src=phpThumb.php?src=$path&h=280></p>
<p align=center><a href=$path rel=lightbox title=$title>enlarge</a></p>
<br />
</td>
</tr>
<tr valign=bottom>
<td>
<table width=330 cellspacing=0 cellpadding=2 bgcolor=#61B329>
<tr valign=top><td width=80 align=right class=light>company:</td><td><b class=white>$title</b></td></tr>
<tr valign=top><td align=right class=light>category:</td><td class=white>$category</td></tr>
<tr valign=top><td align=right class=light>description:</td><td class=white>$description<p><a href=\"http://$url\" target=\"_blank\" class=\"white\">$url</a></p></td><td></td></tr>
</table>
</td>
</tr>
</table>";
}
...clode db code