Codice:
Dopo aver aver eseguito la query select:
$query=mysql_query("SELECT .....");
forma un array con i record estratti(puoi farlo in diversi modi): esempio:
$array=mysql_fetch_assoc($query);
while(condizione fin quando vuoi che il while venga eseguito. Mettendo come condizione la riga precedente ($array ecc..) il while verrà eseguito fin quando ci saranno record da estrarre){
if($array['nome_prodotto']=="xxxx" && $array['quantita_prodotto']<=2){ echo "<font color="#ff0000">". $array['quantita_prodotto']."</font>";} else echo $array['quantita_prodotto'];}