-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
88 lines (57 loc) · 1.31 KB
/
Copy pathadmin.html
File metadata and controls
88 lines (57 loc) · 1.31 KB
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
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel</title>
<style type="text/css">
#h2 {
position: relative;
left: 40%;
font-family: helvetica;
font-size: 35px;
text-transform: uppercase;
}
form {
display: block;
margin-left: auto;
margin-right: auto;
width: 75%;
/*border: 2px solid black;*/
}
#input {
width: 90%;
height: 40px;
}
#sub {
height: 50px;
width: 70px;
}
</style>
</head>
<body>
<h2 id="h2">Admin Panel</h2>
<form action="admin.php" method="POST">
<input type="text" name="query" id="input" placeholder="Type Query Here"></input>
<input type="submit" id="sub" value="Run"/>
</form>
<?php
$host='localhost';
$user='root';
$pass='';
$db='E-Commerce_try';
$con=mysqli_connect($host,$user,$pass,$db);
if($con)
echo "Connection Successful";
$sql=$_POST['query'];
$query=mysqli_query($con,$sql);
if(!$query)
echo "Query UnSuccessful" . mysql_error();
while($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
echo "EMP ID :{$row['emp_id']} <br> ".
"EMP NAME : {$row['emp_name']} <br> ".
"EMP SALARY : {$row['emp_salary']} <br> ".
"--------------------------------<br>";
mysql_close($con);
?>
</body>
</html>