I have a problem here. I’ve tried searching everywhere but can’t seems to find it. I know there’s post about this out there, maybe I can’t get my search query right.
It’s similar to this 2 that I’ve found:
Applying different CSS to top 10 results of a query
.addClass with IF statement based on value
Currently here’s a brief example of my code:
<?php
$select=mysql_query("select * from products_list ORDER BY id ASC");
while($row=mysql_fetch_array($select)){
echo "<tr>
<td>".$row['id']."</td>
<td>".$row['title']."</td>
<td>".$row['new_arrival']."</td>";
?>
The data for new_arrival in the database is either yes or no.
My question is how do I add a class for the “new_arrival” on the TD if it is “yes” and no class added if it is “no”
Hope you guys understand what I’m trying to say. Thanks.
Regards,
Jeff
1 Answer