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 "<div class='imageBorder span-8 column" . $additionalClass . "'>";
echo "<div id='imageHeight'>";
echo "<img src='thumbs/$image'>";
echo "</div>";
echo "<ul>";
echo "<li>$name</l1>";
echo "<li>$about</l1>";
echo "<li>$company</l1>";
echo "<li><a href='$buy'>BUY</a></l1>";
echo "<li>$tags</l1>";
echo "</ul>";
echo "</div>";
}/*SHOEDATA WHILE LOOP ENDS */
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…