mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
5afd45c16a
commit
39a39b66ad
1 changed files with 13 additions and 1 deletions
|
@ -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')");
|
||||
|
|
Loading…
Reference in a new issue