HI Guys
Firstly thanks for all the great replies. It really helped me. Filter is sorted. Pagination works great i even added a search function 😃
One more thing. I display 4 images per page. Now at the moment i'm moving to the next id by using ++ after the current id. now thats wrong becuase i need to move to the next row in the query because a photo can be deleted and the id's may not follow after each other. Below is a section of the code. I have tried about anything, but cant get it to work for the life of me.
$q = mysql_query("$fullquery");
if(!$q) die(mysql_error());
$err = mysql_num_rows($q);
if($err == 0){ print "<span class='no_result'><br><br><br><div align='center'>No matches met your criteria.<br>Please try another combination</div></span>";} ?>
<table width='545' height='312' border='0' cellspacing='0' cellpadding='0'>
<?php //show data matching query:
while($code = mysql_fetch_object($q)) {
?>
<tr>
<td width='273' height='90' align='center' valign='top'>
<a href="#"><img src='viewThumb.php?id=<? print "$code->id"; ?>' border='0' onclick="MM_openBrWindow('viewLarge.php?id=<? print "$code->id"; ?>','','scrollbars=yes,resizable=yes,width=500,height=500')" /></a> </td>
<td width='272' height='90' align='center' valign='top'>
<?php if($thisrow = mysql_fetch_row($q))
{
$code->id++; ?>
<a href="#"><img src='viewThumb.php?id=<? print "$code->id"; ?>' border='0' onclick="MM_openBrWindow('viewLarge.php?id=<? print "$code->id"; ?>','','scrollbars=yes,resizable=yes,width=500,height=500')" /></a>
<? } ?> </td>
</tr>
<tr>
<td width='273' height='90' align='center' valign='bottom'>
<?php if($thisrow = mysql_fetch_row($q))
{
$code->id++;
?>
<a href="#"><img src='viewThumb.php?id=<? print "$code->id"; ?>' border='0' onclick="MM_openBrWindow('viewLarge.php?id=<? print "$code->id"; ?>','','scrollbars=yes,resizable=yes,width=500,height=500')" /></a>
<? } ?> </td>
<td height='90' align='center' valign='bottom'>
<?php
if($thisrow = mysql_fetch_row($q))
{
$code->id++; ?>
<a href="#"><img src='viewThumb.php?id=<? print "$code->id"; ?>' border='0' onclick="MM_openBrWindow('viewLarge.php?id=<? print "$code->id"; ?>','','scrollbars=yes,resizable=yes,width=500,height=500')" /></a>
<? } ?> </td>
</tr>
<?php } ?>
This where in incremint it.
$code->id++;
Thanks in advance