if($datos && mysql_num_rows($datos) > 0) { $fila = mysql_fetch_row($datos); $maximo = $fila[0]; echo $maximo; }