Guest User

Untitled

a guest
Sep 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. try {
  2. $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
  3. foreach($dbh->query('SELECT * from FOO') as $row) {
  4. print_r($row);
  5. }
  6. $dbh = null;
  7. } catch (PDOException $e) {
  8. print "Error!: " . $e->getMessage() . "<br/>";
  9. die();
  10. }
Add Comment
Please, Sign In to add comment