-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
40 lines (27 loc) · 836 Bytes
/
view.php
File metadata and controls
40 lines (27 loc) · 836 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
<?php
$db_user = 'root';
$db_pass = "";
$db = 'test';//test
$conn = mysqli_connect('localhost',$db_user,$db_pass) or die('Unable to connect database');
mysqli_select_db($conn,$db)or die("cannot connect database practice");
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT uname, pwd FROM login';
$retval = mysqli_query( $conn, $sql);
if(! $retval )
die('Could not get data: ' . mysql_error());{
echo "<table>";
echo "<tr>";
echo "<th>Username</th>";
echo "<th>Password</th>";
echo "</tr>";
while($row = mysqli_fetch_array($retval)) {
echo "<tr>";
echo "<td>" . $row[0] . "</td>";
echo "<td>" . $row[1] . "</td>";
echo "</tr>";
}
echo "</table>";
}
?>