2004-05-13 14:54:59 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2005-01-14 05:42:48 +00:00
|
|
|
<!-- $Revision: 1.6 $ -->
|
2004-05-13 14:54:59 +00:00
|
|
|
<refentry id="function.sqlite-factory">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>sqlite_factory</refname>
|
2005-01-14 05:42:48 +00:00
|
|
|
<refpurpose>Opens a SQLite database and returns a SQLiteDatabase object</refpurpose>
|
2004-05-13 14:54:59 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
2005-01-12 08:56:59 +00:00
|
|
|
<type>SQLiteDatabase</type><methodname>sqlite_factory</methodname>
|
2004-05-13 14:54:59 +00:00
|
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
2004-11-10 08:30:50 +00:00
|
|
|
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam>
|
2004-05-13 14:54:59 +00:00
|
|
|
</methodsynopsis>
|
2005-01-14 05:42:48 +00:00
|
|
|
<para>
|
|
|
|
Returns a SQLiteDatabase object on success, &null; on error.
|
|
|
|
</para>
|
2005-01-12 08:56:59 +00:00
|
|
|
<para>
|
|
|
|
<function>sqlite_factory</function> behaves similarly to
|
|
|
|
<function>sqlite_open</function> in that it opens an SQLite database or
|
|
|
|
attempts to create it if it does not exist. However, a
|
|
|
|
<link linkend="sqlite.class.sqlitedatabase">SQLiteDatabase</link> object is
|
2005-01-14 05:42:48 +00:00
|
|
|
returned rather than a resource. Please see the
|
|
|
|
<function>sqlite_open</function> reference page for further usage and caveats.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>sqlite_factory</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$dbhandle = sqlite_factory('sqlitedb');
|
|
|
|
$dbhandle->query('SELECT user_id, username FROM users');
|
|
|
|
|
|
|
|
/* functionally equivalent to: */
|
|
|
|
|
|
|
|
$dbhandle = new SQLiteDatabase('sqlitedb');
|
|
|
|
$dbhandle->query('SELECT user_id, username FROM users');
|
|
|
|
|
|
|
|
?>]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2005-01-12 08:56:59 +00:00
|
|
|
<para>
|
|
|
|
See also <function>sqlite_open</function> and
|
|
|
|
<function>sqlite_popen</function>.
|
|
|
|
</para>
|
2004-05-13 14:54:59 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|