Jump to content


Photo

Next-Previous links not working.


  • Please log in to reply
2 replies to this topic

#1 Immortal55

Immortal55
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 09 April 2006 - 11:22 PM

When I click the 'next' link nothing changes except the value of rowstart in the URL bar.

What is wrong?:

if (!$rowstart) $rowstart = 0;
    $sql = mysql_query("SELECT * FROM user_art where user = '{$_REQUEST['user']}' and catagory = '{$_REQUEST['cid']}' order by id desc limit 15") or die(mysql_error());
    $sql2 = mysql_query("SELECT * FROM user_art where user = '{$_REQUEST['user']}' and catagory = '{$_REQUEST['cid']}'") or die(mysql_error());
    
    $numrows = mysql_num_rows($sql2);
    

//the above line would get all your users, and order them by their Id's
// the loop below would then make a link for every user
        
    while($row = mysql_fetch_array($sql))
    {
    stripslashes($row);
    
    $id = $row['id'];
    
    if($HTTP_SESSION_VARS['valid_user'] == $_REQUEST['user'])
    {        echo "<a href='picturefull.php?id=$id'>" . $row['title'] . "</a> - " . $row['description'] . " ";            
            echo " - [<a href='updateart.php?id=$id'>edit</a>] [<a href='deleteart.php?id=$id'>delete</a>]<br><br>";
    }else {
            echo "<a href='picturefull.php?id=$id'>" . $row['title'] . "</a> - " . $row['description'] . "<br>";            }
    }
    
    echo "<br><br>";
    if ($rowstart != 0) {
        echo "<a href='$PHP_SELF?user=".$_REQUEST['user']."&cid=".$_REQUEST['cid']."&rowstart=".($rowstart - 15)."'>Last 15</a>";
        }
    if (($rowstart + 15) < $numrows) {
        echo "<a href='$PHP_SELF?user=".$_REQUEST['user']."&cid=".$_REQUEST['cid']."&rowstart=".($rowstart + 15)."'>Next 15</a>";
        }

?>


#2 Immortal55

Immortal55
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 09 April 2006 - 11:42 PM

if you need any more information, less code, or information on the code, let me know, I really need to figure this out!

#3 Immortal55

Immortal55
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 April 2006 - 02:11 AM

anybody?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users