$sql = mysql_query("select cant from contrato where idcontrato='$idcontrato' ",$link);$x = mysql_result($sql, 0);