-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallUsers.php
More file actions
34 lines (28 loc) · 809 Bytes
/
allUsers.php
File metadata and controls
34 lines (28 loc) · 809 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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
error_reporting(E_ALL);
$servername = "localhost";
$username = "root";
$password = "t3cht0n!c";
$db = "myDatabase";
// Create connection
//mysqli_connect($servername, $username, $password, $db) or die(mysqli_err);
$conn = new mysqli($servername, $username, $password, $db);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT FirstName, LastName, Email FROM users";
$result = mysqli_query($conn, $sql);
while($row = $result->fetch_assoc()) {
echo "Name: " . $row["FirstName"]. " " . $row["LastName"]. " email: " . $row["Email"]. "<br>";
}
$conn->close();
?>
</body>
</html>