Jump to content


Photo

Pictures got the same link


  • Please log in to reply
No replies to this topic

#1 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 16 June 2006 - 04:37 PM

this a code dividing picture sin different pages.. can any one tell me why does the pictures in the other pages, got the same link as the one in the first page...
$query=mysql_query("SELECT path,photo_id FROM tra_cotm_photo WHERE cotm_id='".$info['cotm_id']."' ORDER BY photo_id DESC LIMIT $cut,$max_page ")or die (mysql_error());

$get_num=mysql_result(mysql_query("SELECT COUNT(*) FROM tra_cotm_photo WHERE cotm_id=".$info['cotm_id'].""),0);

$total_pages=ceil($get_num / $max_page);
if($_GET['m']==$info['cotm_id']){
while($path=mysql_fetch_array($query)){
  if($i % $limit != 1) { 
?><td align="center"><a href="cfv.php?m=<?php echo $info['cotm_id'];?>&p=<?php echo $i; ?>"><img border="0" height="90" width="110" src="<?php echo $path['path'];?>"></a></td>
<?php  } else { ?> 
    </tr><tr><td  align="center"><a href="cfv.php?m=<?php echo $info['cotm_id']; ?>&p=<?php echo $i;?>"><img border="0" height="90" width="110" src="<?php echo $path['path'];?>"></a></td>
<?php  } 
$i++; 
}
}else
{}    


<?php if($_GET['m']==$info['cotm_id']){
?>
          <tr>
            <td colspan="3" align="center">
                <?php


for($i = 1; $i <= $total_pages; $i++){ 
    if(($page) == $i){ 
        echo "$i "; 
        } else { 
            echo "<a href=\"".$_SERVER['PHP_SELF']."?m=".$info['cotm_id']."&page=$i\">$i</a> "; 
    } 
}
 
}else
{}    

?>

EDITED BY WILDTEEN88: PLEASE USE SUITABLE TOPIC TITLES WHEN POSTING A NEW TOPIC. I HAVE CHANGED THE TITLE FOR YOU.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users