-
Notifications
You must be signed in to change notification settings - Fork 0
/
artistsearch.php
152 lines (140 loc) · 3.85 KB
/
artistsearch.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<html>
<head>
<title>Search Artist</title>
</head>
<style>
table{
border-collapse: collapse;
width: 60%;
padding: 150px;
margin-left: 280px;
}
th, td {
text-align: center;
padding: 8px;
border-radius: 12px;
}
tr:nth-child(even)
{
background-color: #f2f2f2;
font-family: "arial";
font-weight: bold;
}
th {
background-color: mediumslateblue;
color: white;
font-family: "verdana";
font-weight: bold;
}
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: 60%;
}
div{
font-family: "verdana";
font-weight: bold;
font-size: 30px;
font-style: 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;
}
b{
font-family: "verdana";
background-color: lightcyan;
color: black;
margin-left:80px;
border-radius: 8px;
text-align: center;
font-size: 30px;
width: 85%;
}
span{
font-family: "verdana";
background-color: lightcyan;
color: black;
margin-top:4px;
border-radius: 8px;
text-align: center;
font-size: 30px;
margin-left:0px;
width: 35%;
font-weight: bold;
}
</style>
<body style="background-color: lavender">
<h1><center><font style="border:9px solid grey" face="arial">SEARCH FROM ARTIST TABLE </font></center></h1>
<form action="artistsearch.php" method="post">
<div>Enter Artist ID:<input type="text" name="artistid"><br></div>
<br><br>
<button type="submit" value ="Find" class="btn">SEARCH</button>
</form>
<?php
$host="localhost";
$user="root";
$password="Shubh@123";
$con= new mysqli($host,$user,$password,"art_gallery");
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$n=$_POST['artistid'];
echo "<b><br>Entered Artist ID is $n <br></b>";
$sql="SELECT * from Artist where artistid='$n'";
$result = $con->query($sql);
if ($result->num_rows > 0) {
echo "<b><br>Search Successful<br><br></b>";
echo "<br><br><br><br><table><tr><th>Artist ID</th><th>G_ID</th><th>Cust ID</th><th>E_ID</th><th>FName</th><th>LName</th><th>Birth Place</th><th><br>Style<br></br></th></tr>";
while($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["artistid"]. "</td><td>" . $row["gid"]. "</td><td>" . $row["custid"]. "</td><td>" . $row["eid"]. "</td><td>" . $row["fname1"]. "</td><td>" . $row["lname1"]. "</td><td>" .$row["birthplace"]. "</td><td><br>" . $row["style"]. "<br></br></td></tr>";
}
echo "</table>";
} else {
echo "<span><br><br>OPPS!!! Search Unsuccessful!<br><br>There is no such Artist ID exists. Please Enter Correct Artist ID and Search again.</span>";
}
}
$con->close();
?>
</body>
</html>