Jump to content

Archived

This topic is now archived and is closed to further replies.

Immortal55

Next-Previous links not working.

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]

Share this post


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

Share this post


Link to post
Share on other sites

×

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.