Lo que quiero hacer es utilizar un label de bootstrap dependiendo del dato:
Si es Admin: <span class="label label-danger">Admin</span>
Código PHP:
Ver original
<?php require('config.php'); $desde = @$_GET['pag'] * 10; $hasta = (@$_GET['pag'] * 10) + 10; $staff = $connection->prepare("SELECT * FROM staff LIMIT $desde,$hasta"); $staff->execute(); while($staff1 = $staff->fetch(PDO::FETCH_ASSOC)): switch ($staff1['rango']) { case ($staff1['rango'] == admin): $rango = 'label-danger">Administrador'; break; case ($staff1['rango'] == mod): $rango = 'label-warning">Moderador'; break; case ($staff1['rango'] == dev): $rango = 'label-primary">Developer'; break; case ($staff1['rango'] == help): $rango = 'label-warning">Helper'; break; case ($staff1['rango'] == builder): $rango = 'label-info">Builder'; break; default: $rango = 'RANGO POR DEFECTO'; break; } echo "$rango</span>"; '</a></h5>'; endwhile; $count_news = $connection->query("SELECT COUNT(*) * FROM staff")->fetch(PDO::FETCH_ASSOC); echo '<a href="staff.php?pag='.$i.'">'.$i.'</a>'; endfor; endif; ?>