<?php
session_start();
require('conexion.php');

$id = $_POST['id'];
$id_rec = $_POST['id_rec'];

$query= query("DELETE FROM receta_materia_prima WHERE id= $id");
$qry = query("UPDATE receta
        SET rec_costo=(SELECT SUM(rem_costo_unico) 
        FROM receta_materia_prima WHERE rec_id=$id_rec) WHERE id='$id_rec'");
echo 1;
?>