<?php

	require_once 'dbconfig4.php';
	
	if(isset($_GET['neid']))
	{
		
		$stmt_select = $DB_con->prepare('SELECT image FROM investnews WHERE nid =:neid');
		$stmt_select->execute(array(':neid'=>$_GET['neid']));
		$imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC);
		unlink("img/news/".$imgRow['image']);


		$stmt_delete = $DB_con->prepare('DELETE FROM investnews WHERE nid =:neid');
		$stmt_delete->bindParam(':neid',$_GET['neid']);
		$stmt_delete->execute();

		echo"<script type='text/javascript'>window.location.href = 'news.php';</script>";
		
	}

?>