Skip to content

Instantly share code, notes, and snippets.

@LawnGnome
Created September 4, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LawnGnome/66edb4c3cce643d178f2 to your computer and use it in GitHub Desktop.
Save LawnGnome/66edb4c3cce643d178f2 to your computer and use it in GitHub Desktop.
<?php
@unlink('a.db');
@unlink('b.db');
$a = new PDO('sqlite:a.db');
$b = new PDO('sqlite:b.db');
$a->query('CREATE TABLE a (i INTEGER)');
$b->query('CREATE TABLE b (i INTEGER)');
unset($a);
unset($b);
$a = new PDO('sqlite:a.db');
$a->query('ATTACH DATABASE \'b.db\' AS b');
var_dump($a->query('SELECT * FROM b.b'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment