require("include/top.php");
unset($submitok);
if(!$which || !$what)
$errormessage[] = "no prod from other party selected o_O";
// check the submitted data
if($party || $pyear || $prank || ($ryear))
{
// check user account
if(!isset($_SESSION['SESSION']))
$errormessage[]="you need to be logged in first.";
// check if this prod exists
$query = "SELECT count(0) FROM prods WHERE id=".$which;
$result = mysql_query($query);
if(!mysql_result($result,0))
$errormessage[] = "I can't find this prod o_O";
// if everything is ok
if(!$errormessage)
$submitok=true;
}
// update the prod with the submitted info
if($submitok){
$query = "UPDATE prodotherparty SET ";
if($pyear) {
$party_year=intval($pyear);
$query.= "party_year=".$party_year.", ";
} else {
$query.= "party_year=NULL, ";
}
if($compo) {
$query.= "partycompo=\"".$compo."\", ";
} else {
$query.= "partycompo=NULL, ";
}
if($prank) {
$query.= "party_place=".$prank." ";
} else {
$query.= "party_place=NULL ";
}
$query.='WHERE prod='.$which.' and party='.$what.' LIMIT 1';
mysql_query($query);
}
$result = mysql_query("DESC prodotherparty partycompo");
$row = mysql_fetch_row($result);
$compos = explode("'",$row[1]);
?>