Jump to content

Next-Previous links not working.


Immortal55

Recommended Posts

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

What is wrong?:

[code]
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>";
        }

?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.