-
Notifications
You must be signed in to change notification settings - Fork 13
/
artistdelete.php
110 lines (104 loc) · 2.83 KB
/
artistdelete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<html>
<head>
<title>Delete from Artist</title>
</head>
<style>
b{
font-size: 30px;
font-family: 'Arial';
padding: 27px 62px;
}
input[type=text] {
width: 110px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 9px;
font-size: 16px;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding: 22px 20px 22px 10px;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
font-weight: bold;
font-size: 30px;
}
input[type=text]:focus {
width: 50%;
}
div{
font-family: 'Verdana';
font-size: 35px;
font-weight:bold;
margin-left:25px;
margin-top: 35px;
}
.btn{
background-color: forestgreen;
color: white;
padding: 16px 10px;
margin: 8px 20px 20px 50px;
border-radius: 24px;
cursor: pointer;
width: 10%;
opacity: 0.7;
align-content: center;
font-family: "verdana";
font-weight: bold;
-webkit-box-shadow: 0px 6px 0px green;
-moz-box-shadow: 0px 6px 0px green;
box-shadow: 0px 6px 0px green;
-webkit-transition: all .1s ease-in-out;
-moz-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: translate(0, 5px) rotateX(25deg);
-moz-transform: translate(0, 4px);
transform: translate(0, 4px)
}
.btn:hover
{
opacity: 1;
background-color:forestgreen;
}
</style>
<body style="background-color: lavenderblush">
<h1><center><font style="border:9px solid grey" face="arial">DELETE FROM ARTIST TABLE </font></center></h1>
<form action="artistdelete.php" method="POST">
<div>Enter Artist ID:<input type="text" name="artistid"><br></div>
<br><br>
<button type="submit" value ="Delete" class="btn">DELETE</button>
<button type="reset" value ="Reset" class="btn">RESET</button>
</form>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "art_gallery";
$con = new mysqli($servername, $username, $password, $dbname);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$a=$_POST['artistid'];
if($a!="")
{
$sql1 = "SELECT * from Artist where artistid='$a'";
$result = mysqli_query($con,$sql1);
if(mysqli_num_rows($result)>0)
{
$sql3="DELETE from Artist where artistid='$a'";
mysqli_query($con,$sql3);
echo "<b>Record with artisid = $a is deleted successfully.<b>";
}
else
{
echo "<b>!!!Error in Deleting Record!!!<br> Record '$a' was not found in database.<b>" ;
}
}
else
{
echo "<b>Artist ID Field is Empty</b>";
}
$con->close();
}
?>
</body>
</html>