$consulta = mysql_query("SELECT count(*) as totalreg FROM encuesta WHERE opc='1'"); $row=mysql_fetch_array($consulta); echo $row['totalreg'];