prepare("DELETE FROM bp_products WHERE bp_product_id = ?"); $sql->bind_param('i', $product_id); $rs = $sql->execute(); if($rs) { $response['success'] = true; } else { $response['success'] = false; throw new Exception("Hi ha hagut un error al insertar el registre"); } // if($rs) { // echo ("El registre ha estat satisfactori"); // } else { // echo ("Hi ha hagut un error al insertar el registre"); // } } catch( Exception $e ) { $response['message'] = $e->getMessage(); } echo json_encode($response); } header("Location: ./my-products.php"); ?>