0
I need the last record not to show the <div class="staffClearFix"></div>
<?php
$userdata = mysql_query("SELECT * FROM users WHERE rank = '9' AND status = 'Ativo' ORDER BY id");
while($row = mysql_fetch_assoc($userdata)){
?>
<?php echo $row['username']; ?>
<div class="staffClearFix"></div>
<?php } ?>
But I need to remove the last, not to reverse :(
– user89739
Have you tested the code? It will do exactly what you requested.
– Gabriel Heming
Sorry, I was kind of putting it wrong here... It did work! Could you explain to me how it works? I don’t quite understand how this code works, I’d like to learn.
– user89739
@Carlosg will basically put the
div
always before the name, except if it is the first name. Then, in the first name, there is no div before the name. Now in the second name shall be the div before the name. And it shall be thus: (name | div | name). And so on.– Gabriel Heming