<?php
//$servername = 'localhost';
//$username = 'u842031128_gous364778';
//$password = 'W&n5og=p/k7';
//$dbname = 'u842031128_goprodb545878';

$servername = "localhost";
$username = "u836566291_pcs";
$password = "VSJgO:Y8=rZ";
$dbname = "u836566291_pcs";


$editid = $_GET['id'];


try {
  $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  // set the PDO error mode to exception
  $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

  // sql to delete a record
  $sql = "DELETE FROM `data` WHERE `data`.`id` = $editid";
    
   


  // use exec() because no results are returned
  $conn->exec($sql);
	echo "<script>alert('Record Deleted successfully');</script>";
	echo "<script>window.location.replace('view.php');</script>";
	
} catch(PDOException $e) {
  echo $sql . "<br>" . $e->getMessage();
}

$conn = null;
//$select = $con->prepare("SELECT * FROM `user`");
//$select->setFetchMode(PDO::FETCH_ASSOC);
//$select->execute();

//include "connect.php";
//$id = $_POST['id'];


?>
