diff --git a/management.php b/management.php index 3358b02..628e9a6 100644 --- a/management.php +++ b/management.php @@ -103,8 +103,8 @@ $app->post('/ricetta/body', function () use ($app) { $queryDelete = "DELETE FROM ingredienti where ID_RICETTE = " . $json_data_body->ricettaID; $mysqlconnetion->executeQuery($queryDelete); - $queryDelete = "UPDATE ricette SET data_modifica = NOW() where ID = " . $json_data_body->ricettaID; - $mysqlconnetion->executeQuery($queryDelete); + $queryUpdDataMod = "UPDATE ricette SET data_modifica = NOW() where ID = " . $json_data_body->ricettaID; + $mysqlconnetion->executeQuery($queryUpdDataMod); $retNewID = $json_data_body->ricettaID; } else { @@ -125,7 +125,7 @@ $app->post('/ricetta/body', function () use ($app) { } $query = "insert into ingredienti(ID_TIPO_INGREDIENTI, ID_RICETTE, Quantita, ID_TIPO_QUANTITA, Note, Posizione) values (" . - $arr->ingrediente_id . "," . $retNewID . "," . ($arr->quantita == "" ? "0" : $arr->quantita) . "," . ($arr->tipo_quantita_id == "" ? "NULL" : $arr->tipo_quantita_id) . ",'" . $note . "'," . $pos . ")"; + $arr->ingrediente_id . "," . $retNewID . ",'" . ($arr->quantita == "" ? "0" : $arr->quantita) . "'," . ($arr->tipo_quantita_id == "" ? "NULL" : $arr->tipo_quantita_id) . ",'" . $note . "'," . $pos . ")"; $mysqlconnetion->insertRecord($query); $pos = $pos + 1;