I need one help.I am displaying some data which are coming from DB but i need to set the class name dynamically in each loop iteration using PHP.I am explaining my code below.
<?php
$class=array('classname'=>'pic1-caption bottom-to-top','classname'=>'pic1-caption top-to-bottom','classname'=>'pic1-caption left-to-right','classname'=>'pic1-caption right-to-left','classname'=>'pic1-caption rotate-in','classname'=>'pic1-caption rotate-out','classname'=>'pic1-caption open-up','classname'=>'pic1-caption open-down','classname'=>'pic1-caption open-left','classname'=>'pic1-caption open-right','classname'=>'pic1-caption come-left','classname'=>'pic1-caption come-right');
$sql=mysql_query("select * from phr_health_care where status=1 order by health_id desc");
$key=0;
while($row=mysql_fetch_array($sql)){
?>
<div class="pic1">
<img src="backend/uploads/<?php echo $row['image'] ?>" class="pic1-image" alt="pic1"/>
<span class="pic1-caption bottom-to-top"> //here need to set class name dynamically.
<h1 class="pic1-title">DIABETICS</h1>
<p class="newp"><?php echo $row['title'] ?></p>
<a href="health.html" class="detall">Go for Details</a>
</span>
Here All data are coming from database and i need to set class name in span element
dynamically which are declared in $class
variable .Here also i need once all class declared inside $class
variable will finish while loop continuing ,again it will start from beginning until the db value fetch has not finished.Please help me.