Jump to content

Pagination help


MarkyMarchm

Recommended Posts

Hello

 

Please can someone help me, I currently have all working on my friends online shop other than the pagination.

 

When clicking a topic say category - products matching that category show, which is fine only if there is more than say 12 records i need to split it between php pages. Again works fine on the first page but when I click previous or last it ignores the id (category) and lists all the products not only under 'Black'

 

I am really new to PHP so if you can help please could you show me on my code below so I can make sense of it.

 

here's my could for the category :-

 

<a href='shop_online2.php?id=<?php echo($row['id']) ?>'>

  <?php echo($row['description']) ?></a>

  <?php } while ($row_cat = mysql_fetch_assoc($cat)); ?>

 

here's my code for the next button :-

 

<?

if (!($start>=$record_count-$per_page))

echo " <a href='shop_online2.php?start= $next '>Next</a> ";

?>

 

Hopefully I will only have to add a variable in the last statement, if so could you please show me the correct formatting for this.

 

Hope this makes sense ??  :-\

 

Thanks

 

Marc

 

 

 

 

 

Link to comment
Share on other sites

Thanks harristweed

 

I have the pagination side of things sorted, I just don't know what formatting to use on my next button in order for it to work with my current site and filter i'd'

 

If you could possibly show me what I need to add I would be grateful.

 

<?

if (!($start>=$record_count-$per_page))

echo " <a href='shop_online2.php?start= $next '>Next</a> ";

?>

 

 

Thanks

 

Marc

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.