if (isset($_POST['menu'])) {
$menu = $_POST['menu'];
$delivery = null;
if (isset($_POST['delivery'])) {
$delivery = $_POST['delivery'];
}
$cards = null;
if (isset($_POST['cards'])) {
$cards = $_POST['cards'];
}
$wifi = null;
if (isset($_POST['wifi'])) {
$wifi = $_POST['wifi'];
}
$music = null;
if (isset($_POST['music'])) {
$music = $_POST['music'];
}
$holiday = null;
if (isset($_POST['holiday'])) {
$holiday = $_POST['holiday'];
}
$acessible = null;
if (isset($_POST['acessible'])) {
$acessible = $_POST['acessible'];
}
$address = null;
if (isset($_POST['address'])) {
$address = $_POST['address'];
}
$dateFoundation = null;
if (isset($_POST['date'])) {
$dateFoundation = $_POST['date'];
}
$cnpj = null;
if (isset($_POST['cnpj'])) {
$cnpj = $_POST['cnpj'];
}
$latitude = null;
if (isset($_POST['latitude'])) {
$latitude = $_POST['latitude'];
}
$longitude = null;
if (isset($_POST['longitude'])) {
$longitude = $_POST['longitude'];
}
$link = null;
if (isset($_POST['link'])) {
$link = $_POST['link'];
}
$site = null;
if (isset($_POST['site'])) {
$site = $_POST['site'];
}
$facebook = null;
if (isset($_POST['facebook'])) {
$facebook = $_POST['facebook'];
}
$instagram = null;
if (isset($_POST['instagram'])) {
$instagram = $_POST['instagram'];
}
$googleplus = null;
if (isset($_POST['googleplus'])) {
$googleplus = $_POST['googleplus'];
}
$pinterest = null;
if (isset($_POST['pinterest'])) {
$pinterest = $_POST['pinterest'];
}
$stmtMoreInformations = $conn->prepare("SELECT only_delivery, card_on_delivery, wifi, live_music,
open_holiday, acessible FROM public.menu
WHERE menu_id = :menu");
$stmtMoreInformations->bindValue(":menu", $menu);
if ($stmtMoreInformations->execute()) {
$stmtUpdateMoreInformations = $conn->prepare("UPDATE menu SET only_delivery = :delivery, card_on_delivery = :card,
wifi = :wifi, live_music = :music, open_holiday = :holiday,
acessible = :acessible
WHERE menu_id = :menu");
$stmtUpdateMoreInformations->bindValue(':menu', $menu);
$stmtUpdateMoreInformations->bindValue(':delivery', $delivery);
$stmtUpdateMoreInformations->bindValue(':card', $cards);
$stmtUpdateMoreInformations->bindValue(':wifi', $wifi);
$stmtUpdateMoreInformations->bindValue(':music', $music);
$stmtUpdateMoreInformations->bindValue(':holiday', $holiday);
$stmtUpdateMoreInformations->bindValue(':acessible', $acessible);
$stmtUpdateMoreInformations->execute();
}
Tenho um arquivo php com diversos comandos de insert e update, se executar algum deles eu tenho outra tabela aonde devo dar um insert que algo mudou. Como faço para atribuir uma variável que reconheça que devo dar insert no campo tal?