$sql = mysql_query("select cant from contrato where idcontrato='$idcontrato' ",$link);$x = mysql_fetch_array($sql);echo $x["cant"];