Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $user = 'root';
- $pass = 'root';
- $dbh = new PDO('mysql:host=localhost;dbname=contacts', $user, $pass);
- foreach ($dbh->query('SELECT * from cities') as $row) {
- print_r($row);
- }
- $dbh = null;
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
- ?>
Add Comment
Please, Sign In to add comment