I have this code, in which i have a if statement inside while loop, the problem is that i can't make it work because it always returns the same comment ID after the if statement is accomplished. I couldn´t found a solution. I'd appreciate any help. Thank you.
while($fila = mysql_fetch_assoc($resultado)) {
$archivos = $fila['archivos'];
$fecha = $fila['fecha'];
$comentarioID = $fila['id'];
$comentario = $fila['comentario'];
if(strlen($comentario) > 100){
$comentario = substr($comentario, 0, 100);
$vermas = '...<a href="" class="vermas" id="vermas_'.$comentarioID.'">Ver mas</a>';
}
echo $comentario.$vermas;
}
Aucun commentaire:
Enregistrer un commentaire