<?php

echo 'Current PHP version: ' . phpversion();

$event = $_POST["event"];
$date = $_POST["date"];
	

$servername = "85.10.205.173";
$dbusername = "sumhohoho04";
$dbpassword = "THMSSsumho04";
$dbname = "sumho2017";	

// Create connection
$conn = mysqli_connect($servername, $dbusername, $dbpassword,$dbname,3306);

// Check connection
if (mysqli_connect_errno()) {
     echo "Failed to connect to MySQL: " . mysqli_connect_error();
} 
//echo "Connected successfully";

$sql = "insert into event values('".$event."','".$date."','".$venue."','".$time."')";
echo $sql;
if($conn->query($sql)==True) {
	echo "Record updated successfully";
	header("Location:event.php");
	}
	else
	{
	echo "Error updating record : " . $conn->error;
	header("Location:event.php");
	}




$conn->close();	

?>
<?php include('event.php');
	$epr='';
	$msg='';
	if(isset($_GET['epr']))
		$epr=$_GET['epr'];
		
		
		
		//###########################
		if($epr == 'delete'){
		$$id=$_GET['id'];
		$delete=mysql_query("Delete from event where 'event = $id'");
		if($delete)
		header("location:event.php");
		else
		$msg='Error'.mysql_error();
		}
?>




