-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminTableShow.php
More file actions
71 lines (63 loc) · 1.66 KB
/
adminTableShow.php
File metadata and controls
71 lines (63 loc) · 1.66 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
65
66
67
68
69
70
71
<?php
session_start();
$serverName = "127.0.0.1"; //serverName\instanceName
$userName = "root";
$password = "";
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Table Show</title>
</head>
<body>
<form action="csvFileDownload.php" method="post">
<input type="submit" name="btnCsvFile" value="CSV export">
</form>
</body>
</html>
<?php
$i = 0;
while (1) {
if(isset($_POST['btn_'.$i.''])){
$tableName = $_POST['btn_'.$i.''];
//echo $tableName;
$database = $_SESSION['db'];
$_SESSION['tbName'] = $_POST['btn_'.$i.''];
//echo $database;
$msqlConn = mysqli_connect($serverName, $userName, $password, $database);
if($msqlConn ) {
echo "Connection established.<br />";
$tb_info = mysqli_query($msqlConn, "SELECT * FROM ".$tableName);
$_SESSION['tbInfo'] = $tb_info;
//print_r($tb_list);
?>
<div class="row justify-conten-center">
<table class="table" border="1">
<thead>
<tr>
<th>No</th>
<th>Phone Number</th>
<th>message</th>
</tr>
</thead>
<?php
while ($row = mysqli_fetch_assoc($tb_info)) {
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['phoneNumber']; ?></td>
<td><?php echo $row['message']; ?></td>
</tr>
<?php
}
?>
</table>
</div>
<?php
}
break;
}
$i = $i + 1;
}
?>