I have this script:
<?php
include 'config.php';
if(isset($_POST)){
$user = isset($_POST['user']) ? strip_tags($_POST['user']) : 'HabboColorFS';
$rank = $pdo->query("SELECT * FROM topicos_comentarios WHERE autor='".$user."'")->rowCount();
$usuario = $pdo->prepare("SELECT * FROM usuarios WHERE usuario='".$user."'");
$usuario->execute();
while($ver = $usuario->fetch(PDO::FETCH_ASSOC)){
?>
<?php print $usuario->rowCount(); ?>
<div class="image" style="background-image: url('<?php echo $cx_uploads; ?>/<?php echo $ver['avatar']; ?>')">
<div class="comments"><i class="fa fa-comments" aria-hidden="true"></i> <?php echo $rank; ?></div>
<div class="comments"><i class="fa fa-commenting" aria-hidden="true"></i> 123</div>
<div class="base">
<div class="avatar" style="background-image: url('https://www.habbo.com.br/habbo-imaging/avatarimage?&user=<?php echo $ver['usuario']; ?>&action=std&direction=3&head_direction=3&img_format=png&gesture=std&headonly=0&size=s')"></div>
</div>
</div>
<div class="type day">
<div class="totype"><i class="fa fa-trophy" aria-hidden="true">
</i> RANKING DO DIA</div>
<div class="position">178º</div>
</div>
<div class="type all">
<div class="totype"><i class="fa fa-trophy" aria-hidden="true">
</i> RANKING GERAL</div>
<div class="position">178º</div>
</div>
<?php } } ?>
I'm trying to make an if that when $ user-> rowCount () is 0 it will display an error message "echo" no user found. "
I put print $ user-> rowCount (); and I tried with echo tbm, I already did the if that way, but when I make a deliberate search to empty it it does not display 0.
How can I resolve?