
<%@ page import="java.sql.*" %>
<%@ page import="servlet.conexion_mysql" %>
<%
    String id = request.getParameter("id");

    try (Connection con = conexion_mysql.getConnection()) {
        PreparedStatement ps = con.prepareStatement("DELETE FROM restaurantes WHERE id_restaurantes = ?");
        ps.setInt(1, Integer.parseInt(id));
        ps.executeUpdate();
        response.sendRedirect("index.jsp");
    } catch (Exception e) {
        out.println("Error al eliminar el restaurante.");
        e.printStackTrace();
    }
%>
