Pagination - having trouble paginating a part of a table

OK so for all the products in the table called products I can paginate this quite easily with the following an this works perfectly well on my index.php page

part-1
[php]include “storescripts/connect_to_mysql.php”;
$per_page = 6;
$pages_query = mysql_query(“SELECT COUNT(*) FROM products”);
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset($_GET[‘page’])) ? (int) $_GET[‘page’] : 1;
$start = ($page - 1) * $per_page;[/php]

part-2
[php]<?php if ($pages >= 1 && $page <= $pages) {
for ($x=1; $x<=$pages; $x++) {
echo ($x == $page) ? ‘’ .$x. ’ ’ : ‘’ .$x. ’ ';
}}
?>[/php]

Now when a customer selects for instance the womens section they are taken to the product_list.php page via the link

I am having difficulties trying to get the same code above to paginate only the womens clothing (ignoring mens, fancy dress, lingerie etc).

Can anyone help with that as to what in part-1 or part-2 I need to change to select only products in category womens then paginate them results.

Products table is like this
id - name - category - etc
1 - Dress - Womens - etc
2 - Skirt - Womens - etc
3 - T-Shirt - Mens - etc

Thanks in advance

Sponsor our Newsletter | Privacy Policy | Terms of Service