/    Sign up×
Community /Pin to ProfileBookmark

Next-Previous links not working.

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

What is wrong?:

[code=php]
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]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ViajeroauthorApr 09.2006 — if you need any more information, less code, or information on the code, let me know, I really need to figure this out!
Copy linkTweet thisAlerts:
@ViajeroauthorApr 10.2006 — anybody?
×

Success!

Help @Viajero spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...