Ciao Ragazzi... Secondo voi è giusta una query di COUNT in php creata in questo modo oppure si fa diveramente?

Codice PHP:

$res 
mysql_query("SELECT COUNT(*) As Tot
                FROM Preferiti
                WHERE ID_User=
$id_utente ");

    while (
$result mysql_fetch_array($res))
    { 
       
$num_rows=$result['Tot'];
    }

echo
"Il numero di articoli e': $num_rows"
Soprattutto mi chiedevo se era giusto mettere il while o c'era un altro modo che sprecasse meno risorse...