Jump to content

Php Echo Numbering


jason360

Recommended Posts

Hey guys,

 

Just have a problem I don't know how to fix.  I would like to number each echoed item from my query within the aside id tag for "techSlide" (aside id='techSlide).

 

I would like it to echo like this:

 

<aside id='techSlide1' class='ic_container'>

<aside id='techSlide2' class='ic_container'>

<aside id='techSlide3' class='ic_container'>

<aside id='techSlide4' class='ic_container'>

<aside id='techSlide5' class='ic_container'>

<aside id='techSlide6' class='ic_container'>

 

Thanks in advance!

 

 

 $query = mysql_query('SELECT * FROM products WHERE quantity > 0 AND featured = 1 ORDER BY RAND() LIMIT 6');

                    $i = 0;

                    while ($row = mysql_fetch_array($query))

                    {

                        
                        echo "<aside id='techSlide' class='ic_container'>

									<a href='http://www.mysite.com/shop/product.php?pid=".$row['id']."'>

										<img class='titleImage' src='images/shop/".$row['id'].".jpg'  alt='".$row['name']."' />

										<div class='overlay' style='display:none;'></div>
										

										<div class='ic_caption'>

											<p class='ic_category'>$".number_format($row['price'] , 2)."</p> 
											
											<h3>".$row['name']."</h3>
									</a>
											<p class='ic_text'>

											  ".$row['snippet']."

											</p>

										</div>

									

							  </aside>";		

								

                        $i++;

                    }

 

 

Link to comment
https://forums.phpfreaks.com/topic/275257-php-echo-numbering/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.