Bug #52135 SQLite3::open example does not use open method

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301723 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Brett Bieber 2010-07-30 16:39:58 +00:00
parent 5afd45c16a
commit 39a39b66ad

View file

@ -91,7 +91,19 @@
<programlisting role="php">
<![CDATA[
<?php
$db = new SQLite3('mysqlitedb.db');
/**
* Simple example of extending the SQLite3 class and changing the __construct
* parameters, then using the open method to initialize the DB.
*/
class MyDB extends SQLite3
{
function __construct()
{
$this->open('mysqlitedb.db');
}
}
$db = new MyDB();
$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");