Jump to content

Php Echo Numbering


Go to solution Solved by 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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.