PDO

From GLMWiki
Revision as of 12:45, 11 October 2012 by Kc8wxm (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
$dbh = new PDO(
  'pgsql: host=localhost dbname=demo user=nobody',
  null,
  null,
  array(
       PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
  )
);
$dbh->setAttribute(
    PDO::ATTR_ERRMODE,
    PDO::ERRMODE_EXCEPTION
);
$dbh->query("SET DATESTYLE TO 'SQL, US'");