12345678910111213 |
- <?php
- try {
- $dbh = new PDO('mysql:host=localhost;dbname=test2', "test2", "TeSt2");
- $result = $dbh->query('SELECT * from person');
- print_r(get_class($result) . "\n");
- foreach($result as $row) {
- print_r($row);
- }
- $dbh = null;
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
|