Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'config.php';
- // Select all users from the database
- $selectUsers = $db->prepare('
- SELECT * FROM users
- ');
- $selectUsers->execute();
- $items = $selectUsers->rowCount() ? $selectUsers : [];
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- </head>
- <body>
- <?php if (!empty($items)): ?>
- <h3>Users:</h3>
- <ul>
- <?php foreach ($items as $item): ?>
- <?='<li><a href="profile.php?token=', $item['token'] ,'">', $item['first_name'] ,' ', $item['last_name'] ,'</a></li>'?>
- <?php endforeach; ?>
- </ul>
- <?php else: ?>
- <p>Sorry, there are no registered users!</p>
- <?php endif; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement