**i need help in my code !! **

<?php echo $prev.' '.$next;?>

**when open this page need make next and prev in link ? how can i do it ? I need my link Like It to show in body (Div ) !
how can i make it **

 <?=$prev.' '.$next;?> 

**Like It ? **

<a href="THIS_PAGE_URL?mid=<?php '.($prev).'?>">Prev</a>
<a href="THIS_PAGE_URL?mid=<?php '.($$next).'?>">Next</a>

**Original Code ? **

<?php
$mid=mysql_real_escape_string($_GET['mid']);
$res=mysql_query("select * from images where mid='".$mid."'",$conn);
$prevSQL = mysql_query("SELECT mid, path FROM images WHERE mid > '".$mid."' LIMIT 1");
$nextSQL = mysql_query("SELECT mid, path FROM images WHERE mid < '".$mid."' LIMIT 1");

$row = mysql_fetch_assoc($res);
if(mysql_num_rows($prevSQL)>1){
    $prevRow = mysql_fetch_assoc($prevSQL);
    $prev = '<a href="admin/'.$prevRow['mid'].'">Prev</a>';
} else {
    $prev = 'Prev';
}
if(mysql_num_rows($nextSQL)>1){
    $nextRow = mysql_fetch_assoc($nextSQL);
    $next = '<a href="admin/'.$prevRow['mid'].'">Prev</a>';
} else {
    $next = 'next';
}
?>
<title><?php echo $row['image_title'] ?> | Afrogfx | Home</title>
<div class="gallery-img">
<a href="admin/<?php echo $row['path'] ?>" rel="prettyPhoto" class="portfolio-img" title="<?php echo $row['image_title'] ?>">
<img src="admin/<?php echo $row['path'] ?>" alt="<?php echo $row['image_title'] ?>" width="100%" height="100%" />
</a>


<?php echo $prev.' '.$next;?>

Recommended Answers

All 2 Replies

no way.... do it your self.. Just ask your problem.. here

Please try to explain the problem you are having, and what needs solving. Your post is a little unclear. If you explain, we're likely to help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.