Skip to content

Instantly share code, notes, and snippets.

@hSammir
Created November 5, 2010 13:09
Show Gist options
  • Select an option

  • Save hSammir/664112 to your computer and use it in GitHub Desktop.

Select an option

Save hSammir/664112 to your computer and use it in GitHub Desktop.
Koneksi PHP, Sqlite3 dgn Pendekatan OOP.
<?php
/**
* Sumber: http://id2.php.net/manual/en/sqlite3.open.php
* Sesuaikan file database sqlite3 (dlm contoh: sqlite/data)
*/
class MyDB extends SQLite3
{
function __construct()
{
$this->open('sqlite/data');
}
}
$db = new MyDB();
$result = $db->query('SELECT * from daftar');
var_dump($result->fetchArray());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment