-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtableIndex.php
61 lines (57 loc) · 1.87 KB
/
tableIndex.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
<?php
include_once 'table.php'; //having access to the table.php file
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" />
<style>
.tableHead{
color: white;
background-color:rgb(50, 120, 200);
}
#fileTable{
margin-top: 20px;
}
</style>
</head>
<body>
<!--Creating a table with Bootstrap-->
<table class="table table-striped table-bordered table-hover table-condensed" id="fileTable">
<thead>
<tr class="tableHead">
<th>file_id</th>
<th>user_id</th>
<th>file_name</th>
<th>file_address</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mary</td>
<td>Sanders</td>
<td>mary.sanders@gmail.com</td>
<td>$1500</td>
</tr>
<tr>
<td>Richard</td>
<td>Brook</td>
<td>richard.brook@gmail.com</td>
<td>$2000</td>
</tr>
</tbody>
</table>
<?php
$sql = "SELECT * from files_of_clients;";
$result = mysqli_query($conn, $sql);
$resultCheck = mysqli_num_rows($result);
if($resultCheck > 0){ //if the number of rows in the $result is more than 0
while($row = mysqli_fetch_assoc($result)){ //Keep spitting the data as long as we have results
echo $row['file_id'] ," ",$row['user_id'] ," ",$row['file_name'] ,
" ", $row['file_address'],"<br>"; //We write the name of the column that we want to access
}
}
?>
</body>
</html>