Skip to content

Instantly share code, notes, and snippets.

@rncrtr
Created April 30, 2013 18:19

Revisions

  1. Rn Crtr renamed this gist Sep 25, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Rn Crtr renamed this gist Sep 25, 2013. 1 changed file with 0 additions and 0 deletions.
  3. Rn Crtr revised this gist Sep 25, 2013. No changes.
  4. Rn Crtr renamed this gist Sep 25, 2013. 1 changed file with 0 additions and 0 deletions.
  5. Rn Crtr created this gist Apr 30, 2013.
    13 changes: 13 additions & 0 deletions PHP: connect to mysql with PDO
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <?php
    // fill in this info
    $dbname = 'dbname';
    $server = 'localhost';
    $user = 'root';
    $pass = 'root';

    // db handle
    $dbh = new PDO('mysql:host='.$server.'; dbname='.$dbname, $user, $pass, array(PDO::ATTR_PERSISTENT => true));

    // close connection
    $dbh = null;
    ?>