Ciao e buon Anno a tutti!

Io avrei la necessità di realizzare un form di ricerca che permetta di ricercare gli utenti registrati in una tabella tramite username.

Attualmente ho la seguente pagina che mi stampa solo i risultati e mi permette di modificare, bloccare oppure eliminare un utente.

Posso aggiungere un form di ricerca nella stessa query? se è possibile in che modo?
Ho provato in vari modi ma non essendo esperto continuo a ricevere errori.
Grazie

Codice PHP:
else if($type=='users')
    {
    
$queryString "select u.userid,u.username,u.referral_earned_amount,u.pay_account,u.firstname,u.lastname,u.email,u.mobile,u.user_role,r.role_name,u.created_by,u.user_status
      from annunci_users u,annunci_roles r where u.user_role=4 and r.roleid=u.user_role and u.user_status in ('A','D') "
;
  
        
$pagination = new pagination();
        
$pagination->createPaging($queryString,20);
        
$resultSet $pagination->resultpage;
            
            if(
mysql_num_rows($resultSet)>0)

            { 
        echo 
'    <div class="content pages">';
                        echo 
'<table  style="width: 100%" cellpadding="0" cellspacing="0" class="">';
            echo 
'<tr class="fwb"><td>[b]Username[/b]</td><td>[b]Ruolo[/b]</td><td>[b]Credito[/b]</td><td>[b]Paypal email[/b]<td>[b]Telefono[/b]</td><td>[b]Autore[/b]</td><td>[b]Modifica[/b]</td>';  
    echo 
'</tr>';
    
                while(
$noticia=mysql_fetch_array($resultSet))
                { 
    
                    echo 
'<tr><td>'.ucfirst(html_entity_decode($noticia['username'], ENT_QUOTES)).'</td><td>'.$noticia['role_name'].'</td><td>€ [b]'.$noticia['referral_earned_amount'].'[/b]</td><td>'.$noticia['pay_account'].'</td><td>'.html_entity_decode($noticia['mobile'], ENT_QUOTES).'</td>
                    <td>'
.ucfirst(html_entity_decode($noticia['firstname'], ENT_QUOTES)).'</td>
                    <td>[url="'
.$docroot.'admin/edit/'.$noticia['role_name'].'/'.$noticia['userid'].'/"][/url]';
                    

                  
                  if(
$noticia['user_status']=="D")
                  {
                  echo 
'[url="javascript:;"][/url]';
                  }
                  else
                  {
                  echo 
'[url="javascript:;"][/url]';
                  }

                  echo 
'[url="javascript:;"][/url]';
                    
        
                    echo 
'</td></tr>';
                            }
                        echo 
'</table></div>';

                    echo 
'<table  style="width: 100%" border="0" width="400" align="center">';
        echo 
'<tr><td align="center">';
        
$pagination->displayPaging();
        echo 
'</td></tr>';
        echo 
'</table>';
            
               }
               
            else
            {
                          echo 
'<p class="nodata">Non ci sono dati disponibili</p>';
            }
    }