svn: /phpdoc/en/trunk/reference/sqlite3/sqlite3/ open.xml
| From: | Brett Bieber | Date: | Fri, 30 Jul 2010 16:39:58 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/sqlite3/sqlite3/ open.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6946@lists.php.net to get a copy of this message | ||
saltybeagle Fri, 30 Jul 2010 16:39:58 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=301723
Log:
Bug #52135 SQLite3::open example does not use open method
Bug: http://bugs.php.net/52135 (Open) SQLite3::open example
does not use open method
Changed paths:
U phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml
Modified: phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml
===================================================================
--- phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml 2010-07-30 15:09:51 UTC (rev 301722)
+++ phpdoc/en/trunk/reference/sqlite3/sqlite3/open.xml 2010-07-30 16:39:58 UTC (rev 301723)
@@ -91,8 +91,20 @@
<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')");