Is their a way in a while loop to assign a variable to a class in a div, for every third item in a while loop. I am using the blueprint structure and the third div is at the
for ($i = 0; $i < $numRecords; $i++)
{
$className = "";
if (($i % 3) == 0)
{
$className = "last"
}
....
}
The key part here is the ($i % 3) == 0.
EDIT: The following is in response to your comment.
/* LOOP THROUGH SHOEDATA TABLE */
$results = mysql_query("SELECT * FROM shoeData");
$i = 0;
while($row = mysql_fetch_array($results)){
$i++;
$name = $row['name'];
$about = $row['about'];
$company = $row['company'];
$buy = $row['buy'];
$tags = $row['tags'];
$id = $row['id'];
$image = $row['image'];
/* ECHO THE SHOEDATA RESULTS */
$additionalClass = ($i % 3) == 0 ? " last" : "";
echo "";
echo "";
echo "
";
echo "";
echo "";
echo "- $name";
echo "
- $about";
echo "
- $company";
echo "
- BUY";
echo "
- $tags";
echo "
";
echo "";
}/*SHOEDATA WHILE LOOP ENDS */