<?php
include 'server.php';

session_start();
// error_reporting(1);

if(isset($_SESSION['loggedin']))
{
	$error = array();
	
	$id = $_GET['id'];

	$sql = "DELETE FROM posts WHERE id = '$id'";

	if (mysqli_query($db, $sql)) {

	  header("location: profile.php");

	} else {
	  echo "Error deleting record: " . mysqli_error($conn);
	}

	mysqli_close($db);

}















?>

