<?php

	require_once 'dbconfig.php';
	
	if(isset($_GET['ctid']))
	{
		$stmt_select = $DB_con->prepare('SELECT * FROM mobilecategory WHERE ctid =:ctid');
		$stmt_select->execute(array(':ctid'=>$_GET['ctid']));
		//$imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC);
		//unlink("images/category/".$imgRow['image']);
		
		$stmt_delete = $DB_con->prepare('DELETE FROM mobilecategory WHERE ctid =:ctid');
		$stmt_delete->bindParam(':ctid',$_GET['ctid']);
		$stmt_delete->execute();
		
		//header("Location: category.php");
		echo"<script type='text/javascript'>window.location.href = 'categorylist.php';</script>";
		
	}

?>