First, I know that there is another forum for database-related issues, but I think that my problem lies in my coding, so I put it here...if I'm wrong, feel free to move this to Database.
I have a database of products. They are split by team, category, and pages...I only want 14 items per page. Here is the part of my code giving me trouble:
$x = 1;
$pagenum = $HTTP_GET_VARS["pagenum"] - 1;
while($row = mysql_fetch_array($result))
{
if ($row["Team_"]==$HTTP_GET_VARS["team"] and $row["Category_"]==$HTTP_GET_VARS["page"]) { //Check to see if the item is the right team/category
if ($x > $HTTP_GET_VARS["pagenum"] * 14) { //$x is the number of items in correct team/category - checks to see if it can start the page or not. ex) if it's page #2, makes sure that $x is at least 15
//Code for putting items into page template...taken out for your convenience. :-)
$x = $x + 1; //Move on to the next one.
} else { //This is the right format, right?
$x = $x + 1; //If we're not at 15 (or whatever number) yet, add another one.
}
}
}
If you have any questions at all, please ask.
The first page returns items like they should, but page #2 returns nothing (I have 17 or so items).