Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Ingave</title>
- </head>
- <body>
- <select>
- <?php
- $user = "root";
- $password = "root";
- $database;
- $pdo;
- try {
- $pdo = new PDO("mysql:host=localhost;",
- $user, $password);
- $pdo->setAttribute(PDO::ATTR_ERRMODE,
- PDO::ERRMODE_EXCEPTION);
- $statement = $pdo->query('SHOW DATABASES;');
- while ($row = $statement->fetch()) {
- echo '<option value=$row>$row</option>';
- }
- } catch ( PDOException $e ) {
- print 'Exception!: ' . $e->getMessage();
- }
- ?>
- </select>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement