-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminDatabase.php
More file actions
47 lines (35 loc) · 978 Bytes
/
adminDatabase.php
File metadata and controls
47 lines (35 loc) · 978 Bytes
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
<?php
$serverName = "127.0.0.1"; //serverName\instanceName
$userName = "root";
$password = "";
$msqlConn = mysqli_connect($serverName, $userName, $password);
//$result = mysql_list_dbs($msqlConn);
$db_list = mysqli_query($msqlConn, "SHOW DATABASES");
function get_buttons($db_list){
$str = "";
$i = 0;
$btns = array();
while ($row = mysqli_fetch_assoc($db_list)) {
$btns[$i] = $row['Database'];
$i++;
}
while (list($k, $v) = each($btns)) {
$str.= ' <input type="submit" value="'.$v.'" name="btn_'.$k.'" id="btn_'.$k.'"/>';
}
return $str;
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>User's</title>
</head>
<body>
<form class="" action="adminTableAccordingToUser.php" method="post">
<div id="buttos_panel">
<?php echo get_buttons($db_list); ?>
</div>
</form>
</body>
</html>