e1seix Posted November 16, 2007 Share Posted November 16, 2007 a simple question i know but i'm having trouble implementing it with the following code: while($row = mysql_fetch_array( $fetch )) { // Print out the contents of each row into a table echo "<tr>"; echo "<td style='border-bottom: 1px solid #000000;text-align:center'>"; echo "<span class='lip2'>"; echo '* <a href="'.$_HTTPS['PHP_SELF'].'show.php?sku='.$row['sku'].'&productDetail='.$row['title'].'" style="color:#000000">'; echo $row['size']." "; echo $row['title']." "; echo $row['type']; echo "</a>"; echo "</span>"; echo "</td>"; echo "</tr>"; } I need to replace the "*" with conscentric numbers listing 1 to 10 as the 10 results are listed. i know it's a for i loop but i can't seem to get it right. any help? many thanks, Link to comment https://forums.phpfreaks.com/topic/77672-solved-1-10-list-using-i/ Share on other sites More sharing options...
pocobueno1388 Posted November 16, 2007 Share Posted November 16, 2007 <?php $i=1; while($row = mysql_fetch_array( $fetch )) { // Print out the contents of each row into a table echo "<tr>"; echo "<td style='border-bottom: 1px solid #000000;text-align:center'>"; echo "<span class='lip2'>"; echo $i.' <a href="'.$_HTTPS['PHP_SELF'].'show.php?sku='.$row['sku'].'&productDetail='.$row['title'].'" style="color:#000000">'; echo $row['size']." "; echo $row['title']." "; echo $row['type']; echo "</a>"; echo "</span>"; echo "</td>"; echo "</tr>"; $i++; } ?> Link to comment https://forums.phpfreaks.com/topic/77672-solved-1-10-list-using-i/#findComment-393208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.