Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function commit_crime()
- {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "pgdatabase";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT id, username, password, itime FROM users";
- $result = mysqli_query($conn, $sql);
- if ($result->num_rows > 0) {
- echo "<table><tr><th>ID</th><th>Name</th></tr><th><tr>Password</tr></th>";
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "<tr><td>".$row["id"]."</td><td>".$row["username"]." ".$row["password"]."</td></tr>";
- }
- echo "</table>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement