1. ')); if($apartment_id && $user_id) { $sql = "SELECT * FROM sended_pdf_complexes WHERE id_agent = '$user_id' AND id_object='$apartment_id'"; $rez = mysql_query($sql); if (mysql_num_rows($rez) > 0) { $sql = "UPDATE sended_pdf_complexes SET new_presentation_note ='$presentation_note', new_installment_price ='$new_installment_price' WHERE id_agent = '$user_id' AND id_object='$apartment_id'"; // var_dump($sql);die; mysql_query($sql); } else { $sql = "INSERT INTO sended_pdf_complexes (new_installment_price, new_presentation_note, id_agent, id_object) VALUES ('$new_installment_price, $presentation_note', '$user_id', '$apartment_id')"; // var_dump($sql);die; mysql_query($sql); } } ?>