I search with existing numMec and it appears to me that it does not exist in the database
<?php
if(isset($_POST['search'])){
$searchq = $_POST['search'];
$searchq = preg_replace("#[^0-9]#i","",$searchq);
$query = mysql_query("SELECT * FROM bombeiros WHERE numMec = '%$searchq%'") or die("Nao consegue pesquisar");
$count = mysql_num_rows($query);
if($count==0){
$output='<div class="alert alert-warning alert-dismissable fade-in">
<a class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Bombeiro</strong> não existe na base de dados.
</div>';
}else{
$nome=$row_bombs['Nome'];
$num=$row_bombs['numMec'];
while($row = mysql_fetch_array($query)){
$output='<div class="col-sm mx-auto" style="padding-top: 20px;">
<div class="card" style="width: 300px;">
<img class="mx-auto card-img-top" src="img/BVMCN.png" style="width: 50%; padding-top: 10px;"></br>
<div class="card-body">
<h5 class="card-title"> '.$nome.'</h5>
<a href="bombeiro.php?id="'.$num.' class="btn btn-primary col-sm">'.$num.'</a>
</div>
</div>
</div>';
}
}
}
?>
<?php print("$output");?>
and this at the end of the error (Notice: Undefined variable: output)