cvs: phpdoc /en/reference/maxdb configure.xml constants.xml ini.xml reference.xml /en/reference/maxdb/functions maxdb-affected-rows.xml
maxdb-autocommit.xml maxdb-bind-param.xml maxdb-bind-result.xml maxdb-change-user.xml maxdb-character-set-name.xml maxdb-client-encoding.xml
maxdb-close-long-data.xml maxdb-close.xml maxdb-commit.xml maxdb-connect-errno.xml maxdb-connect-error.xml maxdb-connect.xml maxdb-data-seek.xml
maxdb-debug.xml maxdb-disable-reads-form-master.xml maxdb-disable-rpl-parse.xml maxdb-embedded-connect.xml maxdb-enable-reads-from-master.xml
maxdb-enable-rpl-parse.xml maxdb-errno.xml maxdb-error.xml maxdb-escape-string.xml maxdb-execute.xml maxdb-fetch-array.xml maxdb-fetch-assoc.xml
maxdb-fetch-field-direct.xml maxdb-fetch-field.xml maxdb-fetch-fields.xml maxdb-fetch-lengths.xml maxdb-fetch-object.xml maxdb-fetch-row.xml
maxdb-fetch.xml maxdb-field-count.xml maxdb-field-seek.xml maxdb-field-tell.xml maxdb-free-result.xml maxdb-get-client-info.xml
maxdb-get-client-version.xml maxdb-get-host-info.xml maxdb-get-metadata.xml maxdb-get-proto-info.xml maxdb-get-server-info.xml
maxdb-get-server-version.xml maxdb-info.xml maxdb-init.xml maxdb-insert-id.xml maxdb-kill.xml maxdb-master-query.xml maxdb-more-results.xml
maxdb-multi-query.xml maxdb-next-result.xml maxdb-num-fields.xml maxdb-num-rows.xml maxdb-options.xml maxdb-param-count.xml maxdb-ping.xml
maxdb-prepare.xml maxdb-query.xml maxdb-real-connect.xml maxdb-real-escape-string.xml maxdb-real-query.xml maxdb-report.xml maxdb-rollback.xml
maxdb-rpl-parse-enabled.xml maxdb-rpl-probe.xml maxdb-rpl-query-type.xml maxdb-select-db.xml maxdb-send-long-data.xml maxdb-send-query.xml
maxdb-server-end.xml maxdb-server-init.xml maxdb-set-opt.xml maxdb-sqlstate.xml maxdb-ssl-set.xml maxdb-stat.xml maxdb-stmt-affected-rows.xml
maxdb-stmt-bind-param.xml maxdb-stmt-bind-result.xml maxdb-stmt-close-long-data.xml maxdb-stmt-close.xml maxdb-stmt-data-seek.xml maxdb-stmt-errno.xml
maxdb-stmt-error.xml maxdb-stmt-execute.xml maxdb-stmt-fetch.xml maxdb-stmt-free-result.xml maxdb-stmt-init.xml maxdb-stmt-num-rows.xml
maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml
maxdb-stmt-sqlstate.xml maxdb-stmt-store-result.xml maxdb-store-result.xml maxdb-thread-id.xml maxdb-thread-safe.xml maxdb-use-result.xml
maxdb-warning-count.xml

From: Date: Tue, 08 Mar 2005 16:39:08 +0000
Subject: cvs: phpdoc /en/reference/maxdb configure.xml constants.xml ini.xml reference.xml /en/reference/maxdb/functions maxdb-affected-rows.xml
maxdb-autocommit.xml maxdb-bind-param.xml maxdb-bind-result.xml maxdb-change-user.xml maxdb-character-set-name.xml maxdb-client-encoding.xml
maxdb-close-long-data.xml maxdb-close.xml maxdb-commit.xml maxdb-connect-errno.xml maxdb-connect-error.xml maxdb-connect.xml maxdb-data-seek.xml
maxdb-debug.xml maxdb-disable-reads-form-master.xml maxdb-disable-rpl-parse.xml maxdb-embedded-connect.xml maxdb-enable-reads-from-master.xml
maxdb-enable-rpl-parse.xml maxdb-errno.xml maxdb-error.xml maxdb-escape-string.xml maxdb-execute.xml maxdb-fetch-array.xml maxdb-fetch-assoc.xml
maxdb-fetch-field-direct.xml maxdb-fetch-field.xml maxdb-fetch-fields.xml maxdb-fetch-lengths.xml maxdb-fetch-object.xml maxdb-fetch-row.xml
maxdb-fetch.xml maxdb-field-count.xml maxdb-field-seek.xml maxdb-field-tell.xml maxdb-free-result.xml maxdb-get-client-info.xml
maxdb-get-client-version.xml maxdb-get-host-info.xml maxdb-get-metadata.xml maxdb-get-proto-info.xml maxdb-get-server-info.xml
maxdb-get-server-version.xml maxdb-info.xml maxdb-init.xml maxdb-insert-id.xml maxdb-kill.xml maxdb-master-query.xml maxdb-more-results.xml
maxdb-multi-query.xml maxdb-next-result.xml maxdb-num-fields.xml maxdb-num-rows.xml maxdb-options.xml maxdb-param-count.xml maxdb-ping.xml
maxdb-prepare.xml maxdb-query.xml maxdb-real-connect.xml maxdb-real-escape-string.xml maxdb-real-query.xml maxdb-report.xml maxdb-rollback.xml
maxdb-rpl-parse-enabled.xml maxdb-rpl-probe.xml maxdb-rpl-query-type.xml maxdb-select-db.xml maxdb-send-long-data.xml maxdb-send-query.xml
maxdb-server-end.xml maxdb-server-init.xml maxdb-set-opt.xml maxdb-sqlstate.xml maxdb-ssl-set.xml maxdb-stat.xml maxdb-stmt-affected-rows.xml
maxdb-stmt-bind-param.xml maxdb-stmt-bind-result.xml maxdb-stmt-close-long-data.xml maxdb-stmt-close.xml maxdb-stmt-data-seek.xml maxdb-stmt-errno.xml
maxdb-stmt-error.xml maxdb-stmt-execute.xml maxdb-stmt-fetch.xml maxdb-stmt-free-result.xml maxdb-stmt-init.xml maxdb-stmt-num-rows.xml
maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml
maxdb-stmt-sqlstate.xml maxdb-stmt-store-result.xml maxdb-store-result.xml maxdb-thread-id.xml maxdb-thread-safe.xml maxdb-use-result.xml
maxdb-warning-count.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969366900@lists.php.net to get a copy of this message
simenec Tue Mar 8 11:39:08 2005 EDT Modified files: /phpdoc/en/reference/maxdb configure.xml constants.xml ini.xml reference.xml /phpdoc/en/reference/maxdb/functions maxdb-affected-rows.xml maxdb-autocommit.xml maxdb-bind-param.xml maxdb-bind-result.xml maxdb-change-user.xml maxdb-character-set-name.xml maxdb-client-encoding.xml maxdb-close-long-data.xml maxdb-close.xml maxdb-commit.xml maxdb-connect-errno.xml maxdb-connect-error.xml maxdb-connect.xml maxdb-data-seek.xml maxdb-debug.xml maxdb-disable-reads-form-master.xml maxdb-disable-rpl-parse.xml maxdb-embedded-connect.xml maxdb-enable-reads-from-master.xml maxdb-enable-rpl-parse.xml maxdb-errno.xml maxdb-error.xml maxdb-escape-string.xml maxdb-execute.xml maxdb-fetch-array.xml maxdb-fetch-assoc.xml maxdb-fetch-field-direct.xml maxdb-fetch-field.xml maxdb-fetch-fields.xml maxdb-fetch-lengths.xml maxdb-fetch-object.xml maxdb-fetch-row.xml maxdb-fetch.xml maxdb-field-count.xml maxdb-field-seek.xml maxdb-field-tell.xml maxdb-free-result.xml maxdb-get-client-info.xml maxdb-get-client-version.xml maxdb-get-host-info.xml maxdb-get-metadata.xml maxdb-get-proto-info.xml maxdb-get-server-info.xml maxdb-get-server-version.xml maxdb-info.xml maxdb-init.xml maxdb-insert-id.xml maxdb-kill.xml maxdb-master-query.xml maxdb-more-results.xml maxdb-multi-query.xml maxdb-next-result.xml maxdb-num-fields.xml maxdb-num-rows.xml maxdb-options.xml maxdb-param-count.xml maxdb-ping.xml maxdb-prepare.xml maxdb-query.xml maxdb-real-connect.xml maxdb-real-escape-string.xml maxdb-real-query.xml maxdb-report.xml maxdb-rollback.xml maxdb-rpl-parse-enabled.xml maxdb-rpl-probe.xml maxdb-rpl-query-type.xml maxdb-select-db.xml maxdb-send-long-data.xml maxdb-send-query.xml maxdb-server-end.xml maxdb-server-init.xml maxdb-set-opt.xml maxdb-sqlstate.xml maxdb-ssl-set.xml maxdb-stat.xml maxdb-stmt-affected-rows.xml maxdb-stmt-bind-param.xml maxdb-stmt-bind-result.xml maxdb-stmt-close-long-data.xml maxdb-stmt-close.xml maxdb-stmt-data-seek.xml maxdb-stmt-errno.xml maxdb-stmt-error.xml maxdb-stmt-execute.xml maxdb-stmt-fetch.xml maxdb-stmt-free-result.xml maxdb-stmt-init.xml maxdb-stmt-num-rows.xml maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml maxdb-stmt-sqlstate.xml maxdb-stmt-store-result.xml maxdb-store-result.xml maxdb-thread-id.xml maxdb-thread-safe.xml maxdb-use-result.xml maxdb-warning-count.xml Log: Update documentation

http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/configure.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/configure.xml diff -u phpdoc/en/reference/maxdb/configure.xml:1.1.1.1 phpdoc/en/reference/maxdb/configure.xml:1.2 --- phpdoc/en/reference/maxdb/configure.xml:1.1.1.1 Wed Jan 12 13:52:38 2005 +++ phpdoc/en/reference/maxdb/configure.xml Tue Mar 8 11:39:05 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <section id="maxdb.installation"> &reftitle.install; <para id="maxdb.configure"> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/constants.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/constants.xml diff -u phpdoc/en/reference/maxdb/constants.xml:1.1.1.1 phpdoc/en/reference/maxdb/constants.xml:1.2 --- phpdoc/en/reference/maxdb/constants.xml:1.1.1.1 Wed Jan 12 13:52:39 2005 +++ phpdoc/en/reference/maxdb/constants.xml Tue Mar 8 11:39:05 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <section id="maxdb.constants"> &reftitle.constants; &extension.constants; @@ -96,6 +96,20 @@ </entry> </row> <row> + <entry>MAXDB_ASSOC_UPPER</entry> + <entry> + Columns are returned into the array having the upper case fieldname as the array + index. + </entry> + </row> + <row> + <entry>MAXDB_ASSOC_LOWER</entry> + <entry> + Columns are returned into the array having the lower case fieldname as the array + index. + </entry> + </row> + <row> <entry>MAXDB_BOTH</entry> <entry> Columns are returned into the array having both a numerical index http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/ini.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/maxdb/ini.xml diff -u phpdoc/en/reference/maxdb/ini.xml:1.4 phpdoc/en/reference/maxdb/ini.xml:1.5 --- phpdoc/en/reference/maxdb/ini.xml:1.4 Sat Feb 26 16:08:24 2005 +++ phpdoc/en/reference/maxdb/ini.xml Tue Mar 8 11:39:05 2005 @@ -1,18 +1,17 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <section id="maxdb.configuration"> &reftitle.runtime; &extension.runtime; <para> <table> <title>MaxDB Configuration Options</title> - <tgroup cols="4"> + <tgroup cols="3"> <thead> <row> <entry>Name</entry> <entry>Default</entry> <entry>Changeable</entry> - <entry>Changelog</entry> </row> </thead> <tbody> @@ -20,36 +19,32 @@ <entry>maxdb.default_host</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> - <entry></entry> </row> <row> <entry>maxdb.default_db</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> - <entry></entry> </row> <row> <entry>maxdb.default_user</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> - <entry></entry> </row> <row> - <entry>maxdb.default_pw</entry> + <entry>maxdb.default_password</entry> <entry>NULL</entry> <entry>PHP_INI_ALL</entry> - <entry></entry> </row> <row> <entry>maxdb.long_readlen</entry> - <entry>"200"</entry> + <entry>NULL</entry> <entry>PHP_INI_ALL</entry> - <entry></entry> </row> </tbody> </tgroup> </table> - &ini.php.constants; + For further details and definition of the PHP_INI_* constants see + <function>ini_set</function>. </para> &ini.descriptions.title; @@ -95,9 +90,9 @@ </listitem> </varlistentry> - <varlistentry id="ini.maxdb.default-pw"> + <varlistentry id="ini.maxdb.default-password"> <term> - <parameter>maxdb.default_pw</parameter> + <parameter>maxdb.default_password</parameter> <type>string</type> </term> <listitem> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/reference.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/maxdb/reference.xml diff -u phpdoc/en/reference/maxdb/reference.xml:1.3 phpdoc/en/reference/maxdb/reference.xml:1.4 --- phpdoc/en/reference/maxdb/reference.xml:1.3 Sun Feb 27 12:17:58 2005 +++ phpdoc/en/reference/maxdb/reference.xml Tue Mar 8 11:39:05 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference id="ref.maxdb"> <title>MaxDB PHP Extension</title> <titleabbrev>MaxDB</titleabbrev> @@ -10,11 +10,50 @@ <para> The MaxDB PHP extension allows you to access the functionality provided by MaxDB 7.5.0 and above. More information about the MaxDB Database server - can be found at <ulink url="&url.maxdb;">&url.maxdb;</ulink>. + can be found at <ulink url="http://www.mysql.com/products/maxdb/"></ulink>. </para> <para> + The MaxDB PHP extension is compatible to the MySQL mysqli extension. There are only + minor differences in the behaviour of some functions due to the differences of the + underlying database servers, MaxDB and MySQL. + </para> + <para> + The main differences to mysqli are in the following functions: + </para> + <simplelist> + <member><function>maxdb_character_set_name</function> - returns only ascii or unicode</member> + <member><function>maxdb_disable_reads_from_master</function> - function is experimental</member> + <member><function>maxdb_disable_rpl_parse</function> - function is experimental</member> + <member><function>maxdb_dump_debug_info</function> - function is experimental</member> + <member><function>maxdb_embedded_connect</function> - function is experimental</member> + <member><function>maxdb_enable_reads_from_master</function> - function is experimental</member> + <member><function>maxdb_enable_rpl_parse</function> - function is experimental</member> + <member><function>maxdb_get_client_info</function> - different version string</member> + <member><function>maxdb_get_client_version</function> - different version string</member> + <member><function>maxdb_get_host_info</function> - returns localhost or hostname</member> + <member><function>maxdb_get_server_info</function> - different version string</member> + <member><function>maxdb_get_server_version</function> - different version string</member> + <member><function>maxdb_kill</function> - disconnects session</member> + <member><function>maxdb_master_query</function> - function is experimental</member> + <member><function>maxdb_more_results</function> - functions returns always false</member> + <member><function>maxdb_multi_query</function> - can not handle multiple SQL statements</member> + <member><function>maxdb_next_result</function> - functions returns always false</member> + <member><function>maxdb_options</function> - different set of options</member> + <member><function>maxdb_report</function> - different report modes</member> + <member><function>maxdb_rpl_parse_enabled</function> - function is experimental</member> + <member><function>maxdb_rpl_probe</function> - function is experimental</member> + <member><function>maxdb_rpl_query_type</function> - function is experimental</member> + <member><function>maxdb_send_query</function> - function is experimental</member> + <member><function>maxdb_server_end</function> - function is experimental</member> + <member><function>maxdb_server_init</function> - function is experimental</member> + <member><function>maxdb_ssl_set</function> - function is experimental</member> + <member><function>maxdb_stat</function> - different system status</member> + <member><function>maxdb_stmt_store_result</function> - has no effect</member> + <member><function>maxdb_store_result</function> - has no effect</member> + </simplelist> + <para> Documentation for MaxDB can be found at - <ulink url="&url.maxdb.doc;">&url.maxdb.doc;</ulink>. + <ulink url="http://dev.mysql.com/doc/maxdb/"></ulink>. </para> </section> @@ -22,16 +61,16 @@ &reftitle.required; <para> In order to have these functions available, you must compile PHP with - MaxDB support. Additionally, you must have the MaxDB SQLDBC runtime library + MaxDB support.Additionally, you must have the MaxDB SQLDBC runtime library available to access the MaxDB server. </para> <para> Documentation for MaxDB SQLDBC can be found at - <ulink url="&url.maxdb.doc;">&url.maxdb.doc;</ulink>. + <ulink url="http://dev.mysql.com/doc/maxdb/"></ulink>. </para> <para> Download the MaxDB SQLDBC package from - <ulink url="&url.maxdb.sdbc;">&url.maxdb.sdbc;</ulink>. + <ulink url="http://dev.mysql.com/downloads/maxdb/clients.html"></ulink>. </para> </section> @@ -40,14 +79,315 @@ &reference.maxdb.ini; - &reference.maxdb.constants; + <section id='maxdb.classes'> + &reftitle.classes; + + <section id='maxdb.class.maxdb'> + <title><classname>maxdb</classname></title> + <para> + Represents a connection between PHP and a MaxDB database. + </para> + <section id='maxdb.class.maxdb.constructor'> + &reftitle.constructor; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-connect'>maxdb</link> - construct a new maxdb object</para> + </listitem> + </itemizedlist> + </section> + <section id='maxdb.class.maxdb.methods'> + &reftitle.methods; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-autocommit'>autocommit</link> - turns on or off auto-commiting database modifications</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-change-user'>change_user</link> - changes the user of the specified database connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-character-set-name'>character_set_name</link> - returns the default character set for the database connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-close'>close</link> - closes a previously opened connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-commit'>commit</link> - commits the current transaction</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-connect'>connect</link> - opens a new connection to MaxDB database server</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-debug'>debug</link> - performs debugging operations</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-dump-debug-info'>dump_debug_info</link> - dumps debug information</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-client-info'>get_client_info</link> - returns client version</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-host-info'>get_host_info</link> - returns type of connection used</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-server-info'>get_server_info</link> - returns version of the MaxDB server</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-server-version'>get_server_version</link> - returns version of the MaxDB server</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-init'>init</link> - initializes maxdb object</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-info'>info</link> - retrieves information about the most recently executed query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-kill'>kill</link> - asks the server to kill a MaxDB thread</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-multi-query'>multi_query</link> - performs multiple queries</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-more-results'>more_results</link> - check if more results exist from currently executed multi-query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-next-result'>next_result</link> - reads next result from currently executed multi-query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-options'>options</link> - set options</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-ping'>ping</link> - pings a server connection or reconnects if there is no connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-prepare'>prepare</link> - prepares a SQL query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-query'>query</link> - performs a query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-real-connect'>real_connect</link> - attempts to open a connection to MaxDB database server</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-real-escape-string'>escape_string</link> - escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-rollback'>rollback</link> - rolls back the current transaction</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-select-db'>select_db</link> - selects the default database</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-ssl-set'>ssl_set</link> - sets ssl parameters</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stat'>stat</link> - gets the current system status</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-init'>stmt_init</link>- initializes a statement for use with <link linkend='function.maxdb-stmt-prepare'>maxdb_stmt_prepare</link></para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-store-result'>store_result</link> - transfers a resultset from last query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-use-result'>use_result</link> - transfers an unbuffered resultset from last query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-thread-safe'>thread-safe</link> - returns whether thread safety is given or not</para> + </listitem> + </itemizedlist> + </section> + <section id='maxdb.class.maxdb.properties'> + &reftitle.properties; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-affected-rows'>affected_rows</link> - gets the number of affected rows in a previous MaxDB operation</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-client-info'>client_info</link> - returns the MaxDB client version as a string</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-client-version'>client_version</link> - returns the MaxDB client version as an integer</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-errno'>errno</link> - returns the error code for the most recent function call</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-error'>error</link> - returns the error string for the most recent function call</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-field-count'>field_count</link> - returns the number of columns for the most recent query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-host-info'>host_info</link> - returns a string representing the type of connection used</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-info'>info</link> - retrieves information about the most recently executed query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-insert-id'>insert-id</link> - returns the auto generated id used in the last query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-get-proto-info'>protocol_version</link> - returns the version of the MaxDB protocol used</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-sqlstate'>sqlstate</link> - returns a string containing the SQLSTATE error code for the last error</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-thread-id'>thread_id</link> - returns the thread ID for the current connection</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-warning-count'>warning-count</link> - returns the number of warnings generated during execution of the previous SQL statement</para> + </listitem> + + </itemizedlist> + </section> + </section> + + <section id='maxdb.classes.stmt'> + <title><classname>maxdb_stmt</classname></title> + <para> + Represents a prepared statement. + </para> + <section id='maxdb.class.stmt.methods'> + &reftitle.methods; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-bind-param'>bind_param</link> - binds variables to a prepared statement</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-bind-result'>bind_result</link> - binds variables to a prepared statement for result storage</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-close'>close</link> - closes a prepared statement</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-data-seek'>data-seek</link> - seeks to an arbitrary row in a statement result set</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-execute'>execute</link> - executes a prepared statement</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch'>fetch</link> - fetches result from a prepared statement into bound variables</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-free-result'>free_result</link> - frees stored result memory for the given statement handle</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-result-metadata'>result_metadata</link> - retrieves a resultset from a prepared statement for metadata information</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-prepare'>prepare</link> - prepares a SQL query</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-send-long-data'>send_long_data</link> - sends data in chunks</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-close-long-data'>close_long_data</link> - end sending long data</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-reset'>reset</link> - resets a prepared statement</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-store-result'>store_result</link> - buffers complete resultset from a prepared statement</para> + </listitem> + </itemizedlist> + </section> + <section id='maxdb.class.stmt.properties'> + &reftitle.properties; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-stmt-affected-rows'>affected_rows</link> - returns affected rows from last statement execution</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-errno'>errno</link> - returns errorcode for last statement function</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-error'>errno</link> - returns errormessage for last statement function</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-param-count'>param_count</link> - returns number of parameter for a given prepare statement</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-stmt-sqlstate'>sqlstate</link> - returns a string containing the SQLSTATE error code for the last statement function</para> + </listitem> + </itemizedlist> + </section> + </section> + + <section id='maxdb.classes.result'> + <title><classname>maxdb_result</classname></title> + <para> + Represents the result set obtained from a query against the database. + </para> + <section id='maxdb.class.result.methods'> + &reftitle.methods; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-free-result'>close</link> - closes resultset</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-data-seek'>data_seek</link> - moves internal result pointer</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-field'>fetch_field</link> - gets column information from a resultset</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-fields'>fetch_fields</link> - gets information for all columns from a resulset</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-field-direct'>fetch_field_direct</link> - gets column information for specified column</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-array'>fetch_array</link> - fetches a result row as an associative array, a numeric array, or both.</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-assoc'>fetch_assoc</link> - fetches a result row as an associative array</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-object'>fetch_object</link> - fetches a result row as an object</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-row'>fetch_row</link> - gets a result row as an enumerated array</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-free-result'>close</link> - frees result memory</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-field-seek'>field_seek</link> - set result pointer to a specified field offset</para> + </listitem> + </itemizedlist> + </section> + <section id='maxdb.class.result.properties'> + &reftitle.properties; + <itemizedlist> + <listitem> + <para><link linkend='function.maxdb-field-tell'>current_field</link> - returns offset of current fieldpointer</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-field-count'>field_count</link> - returns number of fields in resultset</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-fetch-lengths'>lengths</link> - returns an array of columnlengths</para> + </listitem> + <listitem> + <para><link linkend='function.maxdb-num-rows'>num_rows</link> - returns number of rows in resultset</para> + </listitem> + </itemizedlist> + </section> + </section> + </section> + &reference.maxdb.constants; <section id="maxdb.examples"> &reftitle.examples; <para> All examples in the MaxDB PHP documentation use the HOTELDB demo database from MaxDB. More about this - database can be found at <ulink url="&url.maxdb.sampledb;">&url.maxdb.sampledb;</ulink>. + database can be found at <ulink url="http://dev.mysql.com/doc/maxdb/en/98/11b83fa6b33c17e10000000a114084/frameset.htm"></ulink>. + </para> + <para> + To use the examples in the MaxDB PHP documentation, you have to load the tutorial data into your database. + Then you have to set maxdb.default_db in &php.ini; to the database that contains the tutorial data. </para> <para> This simple example shows how to connect, execute a query, print @@ -57,24 +397,26 @@ <programlisting role="php"> <![CDATA[ <?php -/* Connecting, selecting database */ -$link = maxdb_connect("maxdb_host", "maxdb_user", "maxdb_password") - or die("Could not connect : " . maxdb_connect_error()); -echo "Connected successfully"; -maxdb_select_db("my_database") or die("Could not select database"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} /* Performing SQL query */ -$query = "SELECT * FROM my_table"; +$query = "SELECT * FROM hotel.city"; $result = maxdb_query($link, $query) or die("Query failed : " . maxdb_error()); /* Printing results in HTML */ echo "<table>\n"; while ($line = maxdb_fetch_array($result, MAXDB_ASSOC)) { - echo "\t<tr>\n"; + echo " <tr>\n"; foreach ($line as $col_value) { - echo "\t\t<td>$col_value</td>\n"; + echo " <td>$col_value</td>\n"; } - echo "\t</tr>\n"; + echo " </tr>\n"; } echo "</table>\n"; @@ -88,6 +430,80 @@ </programlisting> </example> </para> + <para> + The following example shows how to bind variables to a SELECT INTO statement. + <example> + <title>Example for use of SELECT INTO statements</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (!$link) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* Performing SQL query */ +$stmt = maxdb_prepare ($link, "SELECT percentage INTO ? FROM hotel.countrylanguage where language = ?"); +if (!$stmt) { + printf ("Prepare failed: %s\n", maxdb_error($link)); +} + +$name = "Mbundu"; + +maxdb_stmt_bind_param($stmt, 'ds', $percentage, $name); +maxdb_stmt_execute($stmt); + +printf ("%f\n", $percentage); + +maxdb_stmt_close ($stmt); +?> +]]> + </programlisting> + </example> + </para> + <para> + The following example shows how to use MaxDB database procedures. + <example> + <title>Example fore using database procedures</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (!$link) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +maxdb_report (MAXDB_REPORT_OFF); +maxdb_query($link,"DROP DBPROC test_proc"); +maxdb_report (MAXDB_REPORT_ERROR); + +$query = "create dbproc test_proc (INOUT e_text char(72)) AS select * from SYSDBA.DUAL; fetch into :e_text;"; + +maxdb_query($link, $query); + +/* Performing SQL query */ +$stmt = maxdb_prepare ($link, "CALL test_proc (?)"); +if (!$stmt) { + printf ("Prepare failed: %s\n", maxdb_error($link)); +} + +maxdb_stmt_bind_param($stmt, 's', $result); +maxdb_stmt_execute($stmt); + +printf ("%s\n", $result); + +maxdb_stmt_close ($stmt); +?> +]]> + </programlisting> + </example> + </para> </section> </partintro> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml:1.1.1.1 Wed Jan 12 13:52:41 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-affected-rows.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-affected-rows"> <refnamediv> <refname>maxdb_affected_rows</refname> + <refname>maxdb->affected_rows</refname> <refpurpose>Gets the number of affected rows in a previous MaxDB operation</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>mixed</type><methodname>maxdb_affected_rows</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>mixed</type><varname>affected_rows</varname></fieldsynopsis> + </classsynopsis> <para> <function>maxdb_affected_rows</function> returns the number of rows affected by the last INSERT, UPDATE, or DELETE query associated with the provided <parameter>link</parameter> @@ -48,11 +54,57 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +maxdb_report (MAXDB_REPORT_OFF); +$maxdb->query("DROP TABLE mycustomer"); +maxdb_report (MAXDB_REPORT_ERROR); + +/* Insert rows */ +$maxdb->query("CREATE TABLE mycustomer AS SELECT * from hotel.customer"); +printf("Affected rows (INSERT): %d\n", $maxdb->affected_rows); + +$maxdb->query("ALTER TABLE mycustomer ADD Status int default 0"); + +/* update rows */ +$maxdb->query("UPDATE mycustomer SET Status=1 WHERE cno > 50"); +printf("Affected rows (UPDATE): %d\n", $maxdb->affected_rows); + +/* delete rows */ +$maxdb->query("DELETE FROM mycustomer WHERE cno < 50"); +printf("Affected rows (DELETE): %d\n", $maxdb->affected_rows); + +/* select all rows */ +$result = $maxdb->query("SELECT title FROM mycustomer"); +printf("Affected rows (SELECT): %d\n", $maxdb->affected_rows); + +$result->close(); + +/* Delete table Language */ +$maxdb->query("DROP TABLE mycustomer"); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); if (!$link) { printf("Can't connect to localhost. Error: %s\n", maxdb_connect_error()); @@ -100,7 +152,7 @@ Affected rows (INSERT): 15 Affected rows (UPDATE): 15 Affected rows (DELETE): 0 -Affected rows (SELECT): -1 +Affected rows (SELECT): 15 ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml:1.1.1.1 Wed Jan 12 13:52:42 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-autocommit.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-autocommit"> <refnamediv> <refname>maxdb_autocommit</refname> + <refname> maxdb->auto_commit</refname> <refpurpose>Turns on or off auto-commiting database modifications</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>bool</type><parameter>mode</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>auto_commit</methodname> + <methodparam><type>bool</type><parameter>mode</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_autocommit</function> is used to turn on or off auto-commit mode on queries for the database connection represented by the <parameter>link</parameter> @@ -35,11 +45,32 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* turn autocommit on */ +$maxdb->autocommit(TRUE); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); if (!$link) { printf("Can't connect to localhost. Error: %s\n", maxdb_connect_error()); http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml:1.1.1.1 Wed Jan 12 13:52:42 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-bind-param.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-bind-param"> <refnamediv> <refname>maxdb_bind_param</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml:1.1.1.1 Wed Jan 12 13:52:42 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-bind-result.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-bind-result"> <refnamediv> <refname>maxdb_bind_result</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml:1.1.1.1 Wed Jan 12 13:52:43 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-change-user.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-change-user"> <refnamediv> <refname>maxdb_change_user</refname> + <refname>maxdb->change_user</refname> <refpurpose>Changes the user of the specified database connection</refpurpose> </refnamediv> <refsect1> @@ -15,6 +16,17 @@ <methodparam><type>string</type><parameter>password</parameter></methodparam> <methodparam><type>string</type><parameter>database</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>change_user</methodname> + <methodparam><type>string</type><parameter>user</parameter></methodparam> + <methodparam><type>string</type><parameter>password</parameter></methodparam> + <methodparam><type>string</type><parameter>database</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_change_user</function> is used to change the user of the specified database connection as given by the <parameter>link</parameter> parameter and to set the @@ -51,11 +63,45 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php + +/* connect database test */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if ($result = $maxdb->query("SELECT * FROM dual")) { + $row = $result->fetch_row(); + printf("Result: %s\n", $row[0]); + $result->free(); +} + +/* reset all and select a new database */ +if (!$maxdb->change_user("MONA", "RED", "XXXXXXX")) { + printf("Database not running\n"); +} else { + printf("Database running\n"); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml:1.1.1.1 Wed Jan 12 13:52:43 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-character-set-name.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-character-set-name"> <refnamediv> <refname>maxdb_character_set_name</refname> + <refname>maxdb->character_set_name</refname> <refpurpose>Returns the default character set for the database connection</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>string</type><methodname>maxdb_character_set_name</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>string</type> + <methodname>character_set_name</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Returns the current character set for the database connection specified by the <parameter>link</parameter> parameter. @@ -31,11 +41,34 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* Print current character set */ +$charset = $maxdb->character_set_name(); +printf ("Current character set is %s\n", $charset); + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml:1.1.1.1 Wed Jan 12 13:52:44 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-client-encoding.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-client-encoding"> <refnamediv> <refname>maxdb_client_encoding</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml:1.1.1.1 Wed Jan 12 13:52:44 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-close-long-data.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-close-long-data"> <refnamediv> <refname>maxdb_close_long_data</refname> + <refname>maxdb->close_long_data</refname> <refpurpose>Alias for <function>maxdb_stmt_close_long_data</function></refpurpose> </refnamediv> <refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-close.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-close.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-close.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-close.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-close.xml:1.1.1.1 Wed Jan 12 13:52:44 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-close.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-close"> <refnamediv> <refname>maxdb_close</refname> + <refname>maxdb->close</refname> <refpurpose>Closes a previously opened database connection</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>bool</type><methodname>maxdb_close</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>close</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_close</function> function closes a previously opened database connection specified by the <parameter>link</parameter> parameter. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-commit.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-commit.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-commit.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-commit.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-commit.xml:1.1.1.1 Wed Jan 12 13:52:45 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-commit.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-commit"> <refnamediv> <refname>maxdb_commit</refname> + <refname>maxdb->commit</refname> <refpurpose>Commits the current transaction</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>bool</type><methodname>maxdb_commit</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>commit</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Commits the current transaction for the database connection specified by the <parameter>link</parameter> parameter. @@ -32,12 +42,47 @@ </refsect1> <refsect1> <title>Example</title> + <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* set autocommit to off */ +$maxdb->autocommit(FALSE); + +maxdb_report (MAXDB_REPORT_OFF); +$maxdb->query("DROP TABLE mycustomer"); +maxdb_report (MAXDB_REPORT_ERROR); + +$maxdb->query("CREATE TABLE mycustomer LIKE hotel.customer"); + +/* Insert some values */ +$maxdb->query("INSERT INTO mycustomer VALUES (3000,'Mrs','Jenny','Porter','10580','1340 N.Ash Street, #3')"); +$maxdb->query("INSERT INTO mycustomer VALUES (3100,'Mr','Peter','Brown','48226','1001 34th Str., APT.3')"); + +/* commit transaction */ +$maxdb->commit(); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml:1.1.1.1 Wed Jan 12 13:52:45 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-connect-errno.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-connect-errno"> <refnamediv> <refname>maxdb_connect_errno</refname> @@ -57,10 +57,8 @@ </para> <screen> <![CDATA[ -Affected rows (INSERT): 15 -Affected rows (UPDATE): 15 -Affected rows (DELETE): 0 -Affected rows (SELECT): -1 +PHP Warning: maxdb_connect(): -4008 POS(1) Unknown user name/password combination [08004] <...> +Can't connect to localhost. Errorcode: -4008 ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml:1.1.1.1 Wed Jan 12 13:52:45 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-connect-error.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-connect-error"> <refnamediv> <refname>maxdb_connect_error</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-connect.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-connect.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-connect.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-connect.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-connect.xml:1.1.1.1 Wed Jan 12 13:52:46 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-connect.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-connect"> <refnamediv> <refname>maxdb_connect</refname> + <refname>maxdb()</refname> <refpurpose>Open a new connection to the MaxDB server</refpurpose> </refnamediv> <refsect1> @@ -17,6 +18,19 @@ <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam> <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (constructor):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <constructorsynopsis> + <methodname>__construct</methodname> + <methodparam choice='opt'><type>string</type><parameter>host</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>username</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>passwd</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>dbname</parameter></methodparam> + <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> + </constructorsynopsis> + </classsynopsis> <para> The <function>maxdb_connect</function> function attempts to open a connection to the MaxDB Server running on <parameter>host</parameter> which can be either a host name or an IP address. Passing the @@ -50,11 +64,32 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +printf("Host information: %s\n", $maxdb->host_info); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml:1.1.1.1 Wed Jan 12 13:52:47 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-data-seek.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-data-seek"> <refnamediv> <refname>maxdb_data_seek</refname> + <refname>result->data_seek</refname> <refpurpose>Adjusts the result pointer to an arbitary row in the result</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>data_seek</methodname> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_data_seek</function> function seeks to an arbitrary result pointer specified by the <parameter>offset</parameter> in the result set represented by @@ -37,11 +47,46 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, state FROM hotel.city ORDER BY name"; +if ($result = $maxdb->query( $query)) { + + /* seek to row no. 10 */ + $result->data_seek(10); + + /* fetch row */ + $row = $result->fetch_row(); + + printf ("City: %s State: %s\n", $row[0], $row[1]); + + /* free result set*/ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-debug.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-debug.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-debug.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-debug.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-debug.xml:1.1.1.1 Wed Jan 12 13:52:47 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-debug.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-debug"> <refnamediv> <refname>maxdb_debug</refname> @@ -11,6 +11,21 @@ <type>void</type><methodname>maxdb_debug</methodname> <methodparam><type>string</type><parameter>debug</parameter></methodparam> </methodsynopsis> + <para> + The <function>maxdb_debug</function> can be used to trace the SQLDBC communication. The following + strings can be used as a parameter to <function>maxdb_debug</function>: + </para> + <simplelist> + <member>TRACE SHORT ON|OFF - Enables/disables method call trace.</member> + <member>TRACE LONG ON|OFF - Enables/disables method argument and detail debug trace.</member> + <member>TRACE PACKET ON|OFF|&#x3c;size&#x3e; - Enables/disables packet trace, limiting the size of the + traced object to the specified number of bytes, or 1000 if no size is specified.</member> + <member>TRACE SQL ON|OFF - Enables/disables high level api trace.</member> + <member>TRACE TIMESTAMP ON|OFF - Enables/disables a timestamp prefix on each line that is + traced.</member> + <member>TRACE SIZE &#x3c;size&#x3e; - Limits the size of the trace file to &#x3c;size&#x3e; bytes, + at least 8192 bytes are required.</member> + </simplelist> </refsect1> <refsect1> <title>Return values</title> @@ -24,10 +39,18 @@ <![CDATA[ <?php -/* Create a trace file in '/tmp/client.trace' on the local (client) machine: */ -/* NOTE: Does nothing in case of MaxDB */ -maxdb_debug("d:t:0,/tmp/client.trace"); - +maxdb_debug("trace packet 200"); + +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (!$link) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* close connection */ +maxdb_close($link); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml:1.1.1.1 Wed Jan 12 13:52:47 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-disable-reads-form-master.xml Tue Mar 8 11:39:06 2005 @@ -1,16 +1,26 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-disable-reads-from-master"> <refnamediv> <refname>maxdb_disable_reads_from_master</refname> + <refname>maxdb->disable_reads_from_master</refname> <refpurpose>Disable reads from master</refpurpose> </refnamediv> <refsect1> <title>Description</title> + <para>Procedural style:</para> <methodsynopsis> <type>void</type><methodname>maxdb_disable_reads_from_master</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>void</type><methodname>disable_reads_from_master</methodname> + <void /> + </methodsynopsis> + </classsynopsis> &warn.experimental.func; http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml:1.1.1.1 Wed Jan 12 13:52:47 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-disable-rpl-parse.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-disable-rpl-parse"> <refnamediv> <refname>maxdb_disable_rpl_parse</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml:1.1.1.1 Wed Jan 12 13:52:48 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-embedded-connect.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-embedded-connect"> <refnamediv> <refname>maxdb_embedded_connect</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml:1.1.1.1 Wed Jan 12 13:52:48 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-enable-reads-from-master.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-enable-reads-from-master"> <refnamediv> <refname>maxdb_enable_reads_from_master</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml:1.1.1.1 Wed Jan 12 13:52:48 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-enable-rpl-parse.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-enable-rpl-parse"> <refnamediv> <refname>maxdb_enable_rpl_parse</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-errno.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-errno.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-errno.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-errno.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-errno.xml:1.1.1.1 Wed Jan 12 13:52:48 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-errno.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-errno"> <refnamediv> <refname>maxdb_errno</refname> + <refname>maxdb->errno</refname> <refpurpose>Returns the error code for the most recent function call</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_errno</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_errno</function> function will return the last error code for the most recent MaxDB function call that can succeed or fail with respect to the @@ -37,11 +43,34 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if (!$maxdb->query("SELECT xxx FROM hotel.city")) { + printf("Errorcode: %d\n", $maxdb->errno); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-error.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-error.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-error.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-error.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-error.xml:1.1.1.1 Wed Jan 12 13:52:49 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-error.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-error"> <refnamediv> <refname>maxdb_error</refname> @@ -12,6 +12,11 @@ <type>string</type><methodname>maxdb_error</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_error</function> function is identical to the corresponding <function>maxdb_errno</function> function in every way, except instead of returning @@ -39,11 +44,34 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if (!$maxdb->query("SELECT xxx FROM hotel.city")) { + printf("Errormessage: %s\n", $maxdb->error); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml:1.1.1.1 Wed Jan 12 13:52:49 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-escape-string.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-escape-string"> <refnamediv> <refname>maxdb_escape_string</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-execute.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-execute.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-execute.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-execute.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-execute.xml:1.1.1.1 Wed Jan 12 13:52:49 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-execute.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-execute"> <refnamediv> <refname>maxdb_execute</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml:1.1.1.1 Wed Jan 12 13:52:50 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-array.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-fetch-array"> <refnamediv> <refname>maxdb_fetch_array</refname> + <refname>result->fetch_array</refname> <refpurpose>Fetch a result row as an associative, a numeric array, or both</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch_array</methodname> + <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Returns an array that corresponds to the fetched row or &null; if there are no more rows for the resultset represented by the <parameter>result</parameter> parameter. @@ -33,8 +43,10 @@ <para> The optional second argument <parameter>resulttype</parameter> is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter - are the constants MAXDB_ASSOC, MAXDB_NUM, or MAXDB_BOTH. By default the - <function>maxdb_fetch_array</function> function will assume MAXDB_BOTH for this parameter. + are the constants MAXDB_ASSOC, MAXDB_ASSOC_UPPER, MAXDB_ASSOC_LOWER, MAXDB_NUM, or MAXDB_BOTH. + By default the + <function>maxdb_fetch_array</function> function will assume MAXDB_BOTH, which is a combination of + MAXDB_NUM and MAXDB_ASSOC for this parameter. </para> <para> By using the MAXDB_ASSOC constant this function will behave identically to the @@ -42,6 +54,14 @@ <function>maxdb_fetch_row</function> function. The final option MAXDB_BOTH will create a single array with the attributes of both. </para> + <para> + By using the MAXDB_ASSOC_UPPER constant, the behaviour of this function is identical to the use + of MAXDB_ASSOC except the array index of a column is the fieldname in upper case. + </para> + <para> + By using the MAXDB_ASSOC_LOWER constant, the behaviour of this function is identical to the use + of MAXDB_ASSOC except the array index of a column is the fieldname in lower case. + </para> </refsect1> <refsect1> <title>Return values</title> @@ -60,11 +80,48 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, state FROM hotel.city ORDER by zip"; +$result = $maxdb->query($query); + +/* numeric array */ +$row = $result->fetch_array(MAXDB_NUM); +printf ("%s (%s)\n", $row[0], $row[1]); + +/* associative array */ +$row = $result->fetch_array(MAXDB_ASSOC); +printf ("%s (%s)\n", $row["NAME"], $row["STATE"]); + +/* associative and numeric array */ +$row = $result->fetch_array(MAXDB_BOTH); +printf ("%s (%s)\n", $row[0], $row["STATE"]); + +/* free result set */ +$result->close(); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml:1.1.1.1 Wed Jan 12 13:52:51 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-assoc.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-fetch-assoc"> <refnamediv> <refname>maxdb_fetch_assoc</refname> + <refname>maxdb->fetch_assoc</refname> <refpurpose>Fetch a result row as an associative array</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>array</type><methodname>maxdb_fetch_assoc</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>array</type> + <methodname>fetch_assoc</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Returns an associative array that corresponds to the fetched row or &null; if there are no more rows. @@ -49,11 +59,43 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, state FROM hotel.city ORDER by zip"; + +if ($result = $maxdb->query($query)) { + + /* fetch associative array */ + while ($row = $result->fetch_assoc()) { + printf ("%s (%s)\n", $row["NAME"], $row["STATE"]); + } + + /* free result set */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml:1.2 Sun Feb 13 23:13:15 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-field-direct.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-fetch-field-direct"> <refnamediv> <refname>maxdb_fetch_field_direct</refname> + <refname>result->fetch_field_direct</refname> <refpurpose> Fetch meta-data for a single field </refpurpose> @@ -15,6 +16,15 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch_field_direct</methodname> + <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_fetch_field_direct</function> returns an resource which contains field definition informations from specified resultset. The value of fieldnr must be in the @@ -24,7 +34,7 @@ <refsect1> <title>Return values</title> <para> - Returns a resource which contains field definition information or &false; if no field information + Returns an resource which contains field definition informations or &false; if no field information for specified <literal>fieldnr</literal> is available. </para> <para> @@ -70,11 +80,46 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, cno from hotel.customer ORDER BY name"; + +if ($result = $maxdb->query($query)) { + + /* Get field information for column 'SurfaceArea' */ + $finfo = $result->fetch_field_direct(1); + + printf("Name: %s\n", $finfo->name); + printf("Table: %s\n", $finfo->table); + printf("max. Len: %d\n", $finfo->max_length); + printf("Flags: %d\n", $finfo->flags); + printf("Type: %d\n", $finfo->type); + + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml:1.2 Sun Feb 13 23:13:15 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-field.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-fetch-field"> <refnamediv> <refname>maxdb_fetch_field</refname> + <refname>result->fetch_field</refname> <refpurpose>Returns the next field in the result set</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,14 @@ <type>mixed</type><methodname>maxdb_fetch_field</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type><methodname>fetch_field</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_fetch_field</function> returns the definition of one column of a result set as an resource. Call this function repeatedly to retrieve @@ -23,7 +32,7 @@ <refsect1> <title>Return values</title> <para> - Returns a resource which contains field definition information or &false; if no field information + Returns an resource which contains field definition informations or &false; if no field information is available. </para> <para> @@ -70,11 +79,46 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, cno from hotel.customer ORDER BY cno"; + +if ($result = $maxdb->query($query)) { + + /* Get field information for all columns */ + while ($finfo = $result->fetch_field()) { + + printf("Name: %s\n", $finfo->name); + printf("Table: %s\n", $finfo->table); + printf("max. Len: %d\n", $finfo->max_length); + printf("Flags: %d\n", $finfo->flags); + printf("Type: %d\n\n", $finfo->type); + } + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml:1.2 Sun Feb 13 23:13:15 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-fields.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-fetch-fields"> <refnamediv> <refname>maxdb_fetch_fields</refname> + <refname>result->fetch_fields</refname> <refpurpose>Returns an array of resources representing the fields in a result set</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>mixed</type><methodname>maxdb_fetch_fields</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch_fields</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> This function serves an identical purpose to the <function>maxdb_fetch_field</function> function with the single difference that, instead of returning one resource at a time for @@ -21,7 +31,7 @@ <refsect1> <title>Return values</title> <para> - Returns an array of resources which contains field definition information or &false; if no field information + Returns an array of resources which contains field definition informations or &false; if no field information is available. </para> <para> @@ -67,11 +77,47 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, cno from hotel.customer ORDER BY cno"; + +if ($result = $maxdb->query($query)) { + + /* Get field information for all columns */ + $finfo = $result->fetch_fields(); + + for ($i=0; $i < count($finfo); $i++) { + printf("Name: %s\n", $finfo[$i]->name); + printf("Table: %s\n", $finfo[$i]->table); + printf("max. Len: %d\n", $finfo[$i]->max_length); + printf("Flags: %d\n", $finfo[$i]->flags); + printf("Type: %d\n\n", $finfo[$i]->type); + } + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml:1.1.1.1 Wed Jan 12 13:52:54 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-lengths.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-fetch-lengths"> <refnamediv> <refname>maxdb_fetch_lengths</refname> + <refname>result->lengths</refname> <refpurpose>Returns the lengths of the columns of the current row in the result set</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>mixed</type><methodname>maxdb_fetch_lengths</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <fieldsynopsis><type>mixed</type><varname>lengths</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_fetch_lengths</function> function returns an array containing the lengths of every column of the current row within the result set represented by the @@ -34,11 +40,43 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT * from hotel.customer WHERE cno = 3000"; + +if ($result = $maxdb->query($query)) { + + $row = $result->fetch_row(); + + /* display column lengths */ + for ($i=0; $i < count($result->lengths); $i++) { + printf("Field %2d has Length %2d\n", $i+1, $result->lengths[$i]); + } + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml:1.1.1.1 Wed Jan 12 13:52:55 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-object.xml Tue Mar 8 11:39:06 2005 @@ -1,27 +1,37 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> - <refentry id="function.maxdb-fetch-resource"> +<!-- $Revision: 1.2 $ --> + <refentry id="function.maxdb-fetch-object"> <refnamediv> - <refname>maxdb_fetch_resource</refname> - <refpurpose>Returns the current row of a result set as an resource</refpurpose> + <refname>maxdb_fetch_object</refname> + <refname>result->fetch_object</refname> + <refpurpose>Returns the current row of a result set as an object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> - <type>mixed</type><methodname>maxdb_fetch_resource</methodname> - <methodparam><type>resource</type><parameter>result</parameter></methodparam> + <type>mixed</type><methodname>maxdb_fetch_object</methodname> + <methodparam><type>object</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch_object</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> - The <function>maxdb_fetch_resource</function> will return the current row result set - as an resource where the attributes of the resource represent the names of the fields found + The <function>maxdb_fetch_object</function> will return the current row result set + as an object where the attributes of the object represent the names of the fields found within the result set. If no more rows exist in the current result set, &null; is returned. </para> </refsect1> <refsect1> <title>Return values</title> <para> - Returns an resource that corresponds to the fetched row or &null; if there are no more rows in resultset. + Returns an object that corresponds to the fetched row or &null; if there are no more rows in resultset. </para> &database.field-case; &database.fetch-null; @@ -37,11 +47,43 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, state FROM hotel.city ORDER by zip"; + +if ($result = $maxdb->query($query)) { + + /* fetch object array */ + while ($obj = $result->fetch_object()) { + printf ("%s (%s)\n", $obj->NAME, $obj->STATE); + } + + /* free result set */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml:1.1.1.1 Wed Jan 12 13:52:55 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch-row.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-fetch-row"> <refnamediv> <refname>maxdb_fetch_row</refname> + <refname>result->fetch_row</refname> <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>mixed</type><methodname>maxdb_fetch_row</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch_row</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Returns an array that corresponds to the fetched row, or &null; if there are no more rows. </para> @@ -42,11 +52,43 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, state FROM hotel.city ORDER by zip"; + +if ($result = $maxdb->query($query)) { + + /* fetch object array */ + while ($row = $result->fetch_row()) { + printf ("%s (%s)\n", $row[0], $row[1]); + } + + /* free result set */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml:1.1.1.1 Wed Jan 12 13:52:55 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-fetch.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-fetch"> <refnamediv> <refname>maxdb_fetch</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-field-count.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-field-count"> <refnamediv> <refname>maxdb_field_count</refname> + <refname>maxdb->field_count</refname> <refpurpose>Returns the number of columns for the most recent query</refpurpose> </refnamediv> <refsect1> @@ -10,8 +11,17 @@ <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>maxdb_field_count</methodname> - <methodparam><type>resource</type><parameter>link</parameter></methodparam> + <methodparam><type>object</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>int</type> + <methodname>field_count</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Returns the number of columns for the most recent query on the connection represented by the <parameter>link</parameter> parameter. This function @@ -28,11 +38,44 @@ <title>Example</title> <para> <example> + <title>Object oriented style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +maxdb_report (MAXDB_REPORT_OFF); +$maxdb->query("DROP TABLE friends"); +maxdb_report (MAXDB_REPORT_ERROR); + +$maxdb->query( "CREATE TABLE friends (id int, name varchar(20))"); + +$maxdb->query( "INSERT INTO friends VALUES (1,'Hartmut')"); +$maxdb->query( "INSERT INTO friends VALUES (2, 'Ulf')"); + +if ($maxdb->field_count()) { + /* this was a select/show or describe query */ + $result = $maxdb->store_result(); + + /* process resultset */ + $row = $result->fetch_row(); + + /* free resultset */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); maxdb_report (MAXDB_REPORT_OFF); maxdb_query($link,"DROP TABLE friends"); http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-field-seek.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-field-seek"> <refnamediv> <refname>maxdb_field_seek</refname> + <refname>result->field_seek</refname> <refpurpose> Set result pointer to a specified field offset </refpurpose> @@ -12,9 +13,18 @@ <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>maxdb_field_seek</methodname> - <methodparam><type>resource</type><parameter>result</parameter></methodparam> + <methodparam><type>object</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>int</type> + <methodname>field_seek</methodname> + <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Sets the field cursor to the given offset. The next call to <function>maxdb_fetch_field</function> will retrieve the field definition of the column associated with that offset. @@ -38,11 +48,47 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, cno from hotel.customer ORDER BY cno"; + +if ($result = $maxdb->query($query)) { + + /* Get field information for 2nd column */ + $result->field_seek(1); + $finfo = $result->fetch_field(); + + printf("Name: %s\n", $finfo->name); + printf("Table: %s\n", $finfo->table); + printf("max. Len: %d\n", $finfo->max_length); + printf("Flags: %d\n", $finfo->flags); + printf("Type: %d\n\n", $finfo->type); + + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml:1.1.1.1 Wed Jan 12 13:52:57 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-field-tell.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-field-tell"> <refnamediv> <refname>maxdb_field_tell</refname> + <refname>result->current_field</refname> <refpurpose> Get current field offset of a result pointer </refpurpose> @@ -14,6 +15,14 @@ <type>int</type><methodname>maxdb_field_tell</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <fieldsynopsis> + <type>int</type> + <varname>current_field</varname> + </fieldsynopsis> + </classsynopsis> <para> Returns the position of the field cursor used for the last <function>maxdb_fetch_field</function> call. This value can @@ -36,11 +45,50 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, cno from hotel.customer ORDER BY cno"; + +if ($result = $maxdb->query($query)) { + + /* Get field information for all columns */ + while ($finfo = $result->fetch_field()) { + + /* get fieldpointer offset */ + $currentfield = $result->current_field; + + printf("Column %d:\n", $currentfield); + printf("Name: %s\n", $finfo->name); + printf("Table: %s\n", $finfo->table); + printf("max. Len: %d\n", $finfo->max_length); + printf("Flags: %d\n", $finfo->flags); + printf("Type: %d\n\n", $finfo->type); + } + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml:1.1.1.1 Wed Jan 12 13:52:57 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-free-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-free-result"> <refnamediv> <refname>maxdb_free_result</refname> + <refname>result->free</refname> <refpurpose>Frees the memory associated with a result</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>void</type><methodname>maxdb_free_result</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <methodsynopsis> + <type>void</type> + <methodname>free</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_free_result</function> function frees the memory associated with the result represented by the http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml:1.1.1.1 Wed Jan 12 13:52:58 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-client-info.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-client-info"> <refnamediv> <refname>maxdb_get_client_info</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml:1.1.1.1 Wed Jan 12 13:52:58 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-client-version.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-client-version"> <refnamediv> <refname>maxdb_get_client_version</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml:1.1.1.1 Wed Jan 12 13:52:59 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-host-info.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-host-info"> <refnamediv> <refname>maxdb_get_host_info</refname> + <refname>maxdb->get_host_info</refname> <refpurpose>Returns a string representing the type of connection used</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>string</type><methodname>maxdb_get_host_info</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>host_info</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_get_host_info</function> function returns a string describing the connection represented by the <parameter>link</parameter> @@ -33,11 +39,33 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* print host information */ +printf("Host info: %s\n", $maxdb->host_info); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml:1.1.1.1 Wed Jan 12 13:52:59 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-metadata.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-metadata"> <refnamediv> <refname>maxdb_get_metadata</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml:1.1.1.1 Wed Jan 12 13:52:59 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-proto-info.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-proto-info"> <refnamediv> <refname>maxdb_get_proto_info</refname> + <refname>maxdb->protocol_version</refname> <refpurpose>Returns the version of the MaxDB protocol used</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_get_proto_info</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>protocol_version</varname></fieldsynopsis> + </classsynopsis> <para> Returns an integer representing the MaxDB protocol version used by the connection represented by the <parameter>link</parameter> parameter. @@ -32,11 +38,33 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* print protocol version */ +printf("Protocol version: %d\n", $maxdb->protocol_version); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml:1.1.1.1 Wed Jan 12 13:53:00 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-server-info.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-server-info"> <refnamediv> <refname>maxdb_get_server_info</refname> + <refname>maxdb->server_info</refname> <refpurpose>Returns the version of the MaxDB server</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>string</type><methodname>maxdb_get_server_info</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>server_info</varname></fieldsynopsis> + </classsynopsis> <para> Returns a string representing the version of the MaxDB server that the MaxDB extension is connected to (represented by the @@ -35,11 +41,33 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* print server version */ +printf("Server version: %s\n", $maxdb->server_info); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml:1.1.1.1 Wed Jan 12 13:53:00 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-get-server-version.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-get-server-version"> <refnamediv> <refname>maxdb_get_server_version</refname> @@ -12,6 +12,11 @@ <type>int</type><methodname>maxdb_get_server_version</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>int</type><varname>server_version</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_get_server_version</function> function returns the version of the server connected to (represented by the @@ -40,11 +45,33 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* print server version */ +printf("Server version: %d\n", $maxdb->server_version); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-info.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-info.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-info.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-info.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-info.xml:1.1.1.1 Wed Jan 12 13:53:01 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-info.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-info"> <refnamediv> <refname>maxdb_info</refname> + <refname>maxdb->info</refname> <refpurpose>Retrieves information about the most recently executed query</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>string</type><methodname>maxdb_info</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>info</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_info</function> function returns a string providing information about the last query executed. The nature of this string is @@ -76,11 +82,36 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.t1 LIKE hotel.city"); + +/* INSERT INTO .. SELECT */ +$maxdb->query("INSERT INTO temp.t1 SELECT * FROM hotel.city"); +printf("%s\n", $maxdb->info); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-init.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-init.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-init.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-init.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-init.xml:1.1.1.1 Wed Jan 12 13:53:01 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-init.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-init"> <refnamediv> <refname>maxdb_init</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml:1.1.1.1 Wed Jan 12 13:53:01 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-insert-id.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-insert-id"> <refnamediv> <refname>maxdb_insert_id</refname> + <refname>maxdb->insert_id</refname> <refpurpose>Returns the auto generated id used in the last query</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>mixed</type><methodname>maxdb_insert_id</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>mixed</type><varname>insert_id</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_insert_id</function> function returns the ID generated by a query on a table with a column having the DEFAULT SERIAL attribute. If @@ -38,11 +44,45 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +maxdb_report (MAXDB_REPORT_OFF); +$maxdb->query("DROP TABLE mycity"); +maxdb_report (MAXDB_REPORT_ERROR); + +$maxdb->query("CREATE TABLE mycity LIKE hotel.city"); +$maxdb->query("ALTER TABLE mycity ADD id FIXED(11) DEFAULT SERIAL"); + +$query = "INSERT INTO mycity (zip,name,state) VALUES ('12203','Albany' ,'NY')"; +$maxdb->query($query); + +printf ("New Record has id %d.\n", $maxdb->insert_id); + +/* drop table */ +$maxdb->query("DROP TABLE mycity"); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-kill.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-kill.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-kill.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-kill.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-kill.xml:1.1.1.1 Wed Jan 12 13:53:02 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-kill.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-kill"> <refnamediv> <refname>maxdb_kill</refname> + <refname>maxdb->kill</refname> <refpurpose>Disconnects from a MaxDB server</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>int</type><parameter>processid</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>kill</methodname> + <methodparam><type>int</type><parameter>processid</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> This function is used to disconnect from a MaxDB server specified by the <parameter>processid</parameter> parameter. @@ -31,11 +41,42 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* determine our thread id */ +$thread_id = $maxdb->thread_id; + +/* Kill connection */ +$maxdb->kill($thread_id); + +/* This should produce an error */ +if (!$maxdb->query("CREATE TABLE myCity LIKE City")) { + printf("Error: %s\n", $maxdb->error); + exit; +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml:1.1.1.1 Wed Jan 12 13:53:02 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-master-query.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-master-query"> <refnamediv> <refname>maxdb_master_query</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml:1.1.1.1 Wed Jan 12 13:53:02 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-more-results.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-more-results"> <refnamediv> <refname>maxdb_more_results</refname> + <refname>maxdb->more_results</refname> <refpurpose>Check if there any more query results from a multi query</refpurpose> </refnamediv> <refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml:1.1.1.1 Wed Jan 12 13:53:03 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-multi-query.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-multi-query"> <refnamediv> <refname>maxdb_multi_query</refname> + <refname>maxdb->multi_query</refname> <refpurpose>Performs a query on the database</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>multi_query</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_multi_query</function> works like the function <function>maxdb_query</function>. Multiple queries are not yet supported. @@ -36,11 +46,50 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT * FROM dual"; +$query .= "SELECT name FROM hotel.city ORDER BY zip"; + +/* execute multi query */ +if ($maxdb->multi_query($query)) { + do { + /* store first result set */ + if ($result = $maxdb->store_result()) { + while ($row = $result->fetch_row()) { + printf("%s\n", $row[0]); + } + $result->close(); + } + /* print divider */ + if ($maxdb->more_results()) { + printf("-----------------\n"); + } + } while ($maxdb->next_result()); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB" /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml:1.1.1.1 Wed Jan 12 13:53:03 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-next-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-next-result"> <refnamediv> <refname>maxdb_next_result</refname> + <refname>maxdb->next_result</refname> <refpurpose>Prepare next result from multi_query</refpurpose> </refnamediv> <refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml:1.1.1.1 Wed Jan 12 13:53:04 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-num-fields.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-num-fields"> <refnamediv> <refname>maxdb_num_fields</refname> + <refname>result->field_count</refname> <refpurpose> Get the number of fields in a result </refpurpose> @@ -14,6 +15,11 @@ <type>int</type><methodname>maxdb_num_fields</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>result</classname></ooclass> + <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> + </classsynopsis> <para> <function>maxdb_num_fields</function> returns the number of fields from specified result set. </para> @@ -30,12 +36,42 @@ </refsect1> <refsect1> <title>Example</title> + <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if ($result = $maxdb->query("SELECT * FROM hotel.city ORDER BY zip")) { + + /* determine number of fields in result set */ + $field_cnt = $result->field_count; + + printf("Result set has %d fields.\n", $field_cnt); + + /* close result set */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml:1.1.1.1 Wed Jan 12 13:53:04 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-num-rows.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-num-rows"> <refnamediv> <refname>maxdb_num_rows</refname> @@ -14,6 +14,11 @@ <type>mixed</type><methodname>maxdb_num_rows</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>mixed</type><varname>num_rows</varname></fieldsynopsis> + </classsynopsis> <para> Returns the number of rows in the result set. </para> @@ -49,11 +54,41 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if ($result = $maxdb->query("SELECT cno, name FROM hotel.customer ORDER BY name")) { + + /* determine number of rows result set */ + $row_cnt = $result->num_rows; + + printf("Result set has %d rows.\n", $row_cnt); + + /* close result set */ + $result->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { @@ -83,7 +118,7 @@ </para> <screen> <![CDATA[ -Result set has -1 rows. +Result set has 15 rows. ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-options.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-options.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-options.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-options.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-options.xml:1.1.1.1 Wed Jan 12 13:53:05 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-options.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-options"> <refnamediv> <refname>maxdb_options</refname> + <refname>maxdb->options</refname> <refpurpose>Set options</refpurpose> </refnamediv> <refsect1> @@ -14,6 +15,16 @@ <methodparam><type>int</type><parameter>option</parameter></methodparam> <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>options</methodname> + <methodparam><type>int</type><parameter>option</parameter></methodparam> + <methodparam><type>mixed</type><parameter>value</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_options</function> can be used to set extra connect options and affect behavior for a connection. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml:1.1.1.1 Wed Jan 12 13:53:05 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-param-count.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-param-count"> <refnamediv> <refname>maxdb_param_count</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-ping.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-ping.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-ping.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-ping.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-ping.xml:1.1.1.1 Wed Jan 12 13:53:06 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-ping.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-ping"> <refnamediv> <refname>maxdb_ping</refname> + <refname>maxdb->ping</refname> <refpurpose> Pings a server connection, or tries to reconnect if the connection has gone down </refpurpose> @@ -14,6 +15,14 @@ <type>bool</type><methodname>maxdb_ping</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>ping</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> Checks whether the connection to the server is working. If it has gone down, and global option <literal>maxdb.reconnect</literal> is enabled @@ -32,11 +41,37 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* check if server is alive */ +if ($maxdb->ping()) { + printf ("Our connection is ok!\n"); +} else { + printf ("Error: %s\n", $maxdb->error); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml:1.1.1.1 Wed Jan 12 13:53:07 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-prepare.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-prepare"> <refnamediv> <refname>maxdb_prepare</refname> + <refname>maxdb->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> @@ -15,6 +16,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>prepare</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_prepare</function> prepares the SQL query pointed to by the null-terminated string query, and returns a statement handle to be used for @@ -73,11 +83,53 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$city = "Rosemont"; + +/* create a prepared statement */ +if ($stmt = $maxdb->prepare("SELECT state FROM hotel.city WHERE name=?")) { + + /* bind parameters for markers */ + $stmt->bind_param("s", $city); + + /* execute query */ + $stmt->execute(); + + /* bind result variables */ + $stmt->bind_result($district); + + /* fetch value */ + $stmt->fetch(); + + printf("%s is in district %s\n", $city, $district); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-query.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-query.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-query.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-query.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-query.xml:1.1.1.1 Wed Jan 12 13:53:07 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-query.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-query"> <refnamediv> <refname>maxdb_query</refname> + <refname>maxdb->query</refname> <refpurpose>Performs a query on the database</refpurpose> </refnamediv> <refsect1> @@ -14,6 +15,15 @@ <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resultmode</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>query</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_query</function> function is used to simplify the act of performing a query against the database represented by the @@ -39,11 +49,47 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* Create table doesn't return a resultset */ +if ($maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city") === TRUE) { + printf("Table mycity successfully created.\n"); +} + +/* Select queries return a resultset */ +if ($result = $maxdb->query("SELECT name FROM hotel.city")) { + printf("Select returned %d rows.\n", $result->num_rows); + + /* free result set */ + $result->close(); +} + +/* If we have to retrieve large amount of data we use MAXDB_USE_RESULT */ +if ($result = $maxdb->query("SELECT * FROM hotel.city", MAXDB_USE_RESULT)) { + $result->close(); +} + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { @@ -80,7 +126,7 @@ <screen> <![CDATA[ Table mycity successfully created. -Select returned -1 rows. +Select returned 25 rows. ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml:1.1.1.1 Wed Jan 12 13:53:08 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-real-connect.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-real-connect"> <refnamediv> <refname>maxdb_real_connect</refname> + <refname>maxdb->real_connect</refname> <refpurpose>Opens a connection to a MaxDB server</refpurpose> </refnamediv> <refsect1> @@ -18,6 +19,20 @@ <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam> <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>real_connect</methodname> + <methodparam choice='opt'><type>string</type><parameter>hostname</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>username</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>passwd</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>dbname</parameter></methodparam> + <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_real_connect</function> attempts to establish a connection to a MaxDB database engine running on @@ -57,6 +72,35 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php + +/* create a connection object which is not connected */ +$maxdb = maxdb_init(); + +/* set connection options */ +$maxdb->options(MAXDB_UNICODE, "FALSE"); +$maxdb->options(MAXDB_TIMEOUT, 5); + +/* connect to server */ +$maxdb->real_connect('localhost', 'MONA', 'RED', 'DEMODB'); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +printf ("Connection: %s\n.", $maxdb->host_info); + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ @@ -70,7 +114,7 @@ maxdb_options($link, MAXDB_TIMEOUT, 5); /* connect to server */ -maxdb_real_connect($link, 'localhost', 'MONA', 'RED'); +maxdb_real_connect($link, 'localhost', 'MONA', 'RED', 'DEMODB'); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml:1.1.1.1 Wed Jan 12 13:53:08 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-real-escape-string.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-real-escape-string"> <refnamediv> <refname>maxdb_real_escape_string</refname> + <refname>maxdb->real_escape_string</refname> <refpurpose> Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection @@ -16,6 +17,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>string</type> + <methodname>real_escape_sring</methodname> + <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> This function is used to create a legal SQL string that you can use in a SQL statement. The string <literal>escapestr</literal> is encoded to an escaped SQL string, taking into @@ -40,11 +50,45 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); + +$city = "'s Hertogenbosch"; + +/* this query will fail, cause we didn't escape $city */ +if (!$maxdb->query("INSERT into temp.mycity VALUES ('11111','$city','NY')")) { + printf("Error: %s\n", $maxdb->sqlstate); +} + +$city = $maxdb->real_escape_string($city); + +/* this query with escaped $city will work */ +if ($maxdb->query("INSERT into temp.mycity VALUES ('22222','$city','NY')")) { + printf("%d Row inserted.\n", $maxdb->affected_rows); +} + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml:1.1.1.1 Wed Jan 12 13:53:08 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-real-query.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-real-query"> <refnamediv> <refname>maxdb_real_query</refname> + <refname>maxdb->real_query</refname> <refpurpose>Execute an SQL query</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>real_query</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_real_query</function> is functionally identical with the <function>maxdb_query</function>. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-report.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-report.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-report.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-report.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-report.xml:1.1.1.1 Wed Jan 12 13:53:09 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-report.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-report"> <refnamediv> <refname>maxdb_report</refname> @@ -23,7 +23,7 @@ /* activate reporting */ maxdb_report(MAXDB_REPORT_ERROR); -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml:1.1.1.1 Wed Jan 12 13:53:09 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-rollback.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-rollback"> <refnamediv> <refname>maxdb_rollback</refname> + <refname>maxdb->rollback</refname> <refpurpose>Rolls back current transaction</refpurpose> </refnamediv> <refsect1> @@ -11,6 +12,14 @@ <type>bool</type><methodname>maxdb_rollback</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>rollback</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> Rollbacks the current transaction for the database specified by the <parameter>link</parameter> parameter. @@ -32,11 +41,61 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* disable autocommit */ +$maxdb->autocommit(FALSE); + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); +$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city"); + +/* commit insert */ +$maxdb->commit(); + +/* delete all rows */ +$maxdb->query("DELETE FROM temp.mycity"); + +if ($result = $maxdb->query("SELECT COUNT(*) FROM temp.mycity")) { + $row = $result->fetch_row(); + printf("%d rows in table mycity.\n", $row[0]); + /* Free result */ + $result->close(); +} + +/* Rollback */ +$maxdb->rollback(); + +if ($result = $maxdb->query("SELECT COUNT(*) FROM temp.mycity")) { + $row = $result->fetch_row(); + printf("%d rows in table mycity (after rollback).\n", $row[0]); + /* Free result */ + $result->close(); +} + +/* Drop table myCity */ +$maxdb->query("DROP TABLE temp.mycity"); + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml:1.1.1.1 Wed Jan 12 13:53:09 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-rpl-parse-enabled.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-rpl-parse-enabled"> <refnamediv> <refname>maxdb_rpl_parse_enabled</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml:1.1.1.1 Wed Jan 12 13:53:10 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-rpl-probe.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-rpl-probe"> <refnamediv> <refname>maxdb_rpl_probe</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-rpl-query-type.xml Tue Mar 8 11:39:06 2005 @@ -1,17 +1,25 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-rpl-query-type"> <refnamediv> <refname>maxdb_rpl_query_type</refname> + <refname>maxdb->rpl_query_type</refname> <refpurpose>Returns RPL query type</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>maxdb_rpl_query_type</methodname> - <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>int</type><methodname>rpl_query_type</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> &warn.experimental.func; http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml:1.1.1.1 Wed Jan 12 13:53:11 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-select-db.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-select-db"> <refnamediv> <refname>maxdb_select_db</refname> + <refname>maxdb->select_db</refname> <refpurpose>Selects the default database for database queries</refpurpose> </refnamediv> <refsect1> @@ -41,11 +42,46 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* return name of current default database */ +if ($result = $maxdb->query("SELECT SERVERDB FROM USERS WHERE USERNAME='MONA'")) { + $row = $result->fetch_row(); + printf("Default database is %s.\n", $row[0]); + $result->close(); +} + +/* change db to world db */ +$maxdb->select_db("XXXXXXXX"); + +/* return name of current default database */ +if ($result = $maxdb->query("SELECT SERVERDB FROM USERS WHERE USERNAME='MONA'")) { + $row = $result->fetch_row(); + printf("Default database is %s.\n", $row[0]); + $result->close(); +} + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { @@ -80,7 +116,7 @@ </para> <screen> <![CDATA[ -Default database is DB76. +Default database is <...>. Warning: maxdb_select_db(): -10709 Connection failed (RTE:database not running) <...> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml:1.1.1.1 Wed Jan 12 13:53:11 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-send-long-data.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-send-long-data"> <refnamediv> <refname>maxdb_send_long_data</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml:1.1.1.1 Wed Jan 12 13:53:11 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-send-query.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-send-query"> <refnamediv> <refname>maxdb_send_query</refname> + <refname>maxdb->send_query</refname> <refpurpose>Send the query and return</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,14 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>send_query</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> &warn.experimental.func; http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml:1.1.1.1 Wed Jan 12 13:53:11 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-server-end.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-server-end"> <refnamediv> <refname>maxdb_server_end</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml:1.1.1.1 Wed Jan 12 13:53:11 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-server-init.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-server-init"> <refnamediv> <refname>maxdb_server_init</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml:1.1.1.1 Wed Jan 12 13:53:12 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-set-opt.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-set-opt"> <refnamediv> <refname>maxdb_set_opt</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml:1.1.1.1 Wed Jan 12 13:53:12 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-sqlstate.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-sqlstate"> <refnamediv> <refname>maxdb_sqlstate</refname> + <refname>maxdb->sqlstate</refname> <refpurpose>Returns the SQLSTATE error from previous MaxDB operation</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>string</type><methodname>maxdb_sqlstate</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>string</type><varname>sqlstate</varname></fieldsynopsis> + </classsynopsis> <para> Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. <literal>'00000'</literal> means no error. @@ -41,11 +47,34 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* Table City already exists, so we should get an error */ +if (!$maxdb->query("CREATE TABLE hotel.city (ID INT, Name VARCHAR(30))")) { + printf("Error - SQLSTATE %s.\n", $maxdb->sqlstate); +} + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-ssl-set.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-ssl-set"> <refnamediv> <refname>maxdb_ssl_set</refname> + <refname>maxdb->ssl_set</refname> <refpurpose>Used for establishing secure connections using SSL</refpurpose> </refnamediv> <refsect1> @@ -11,12 +12,24 @@ <methodsynopsis> <type>bool</type><methodname>maxdb_ssl_set</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> - <methodparam><type>string</type><parameter>key</parameter></methodparam> - <methodparam><type>string</type><parameter>cert</parameter></methodparam> - <methodparam><type>string</type><parameter>ca</parameter></methodparam> - <methodparam><type>string</type><parameter>capath</parameter></methodparam> - <methodparam><type>string</type><parameter>cipher</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>key</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>cert</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>ca</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>capath</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>cipher</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>ssl_set</methodname> + <methodparam choice='opt'><type>string</type><parameter>key</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>cert</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>ca</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>capath</parameter></methodparam> + <methodparam choice='opt'><type>string</type><parameter>cipher</parameter></methodparam> + </methodsynopsis> + </classsynopsis> &warn.experimental.func; http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stat.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stat.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stat.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stat.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stat.xml:1.1.1.1 Wed Jan 12 13:53:13 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stat.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stat"> <refnamediv> <refname>maxdb_stat</refname> + <refname>maxdb->stat</refname> <refpurpose>Gets the current system status</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,14 @@ <type>mixed</type><methodname>maxdb_stat</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>mixed</type><methodname>maxdb->stat</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stat</function> returns a string containing several information about the MaxDB server running. @@ -32,11 +41,31 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +printf ("System status: %s\n", $maxdb->stat()); + +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml:1.1.1.1 Wed Jan 12 13:53:13 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-affected-rows.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-affected-rows"> <refnamediv> <refname>maxdb_stmt_affected_rows</refname> + <refname>maxdb_stmt->affected_rows</refname> <refpurpose>Returns the total number of rows changed, deleted, or inserted by the last executed statement </refpurpose> @@ -14,6 +15,11 @@ <type>mixed</type><methodname>maxdb_stmt_affected_rows</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <fieldsynopsis><type>mixed</type><varname>affected_rows</varname></fieldsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_affected_rows</function> returns the number of rows affected by INSERT, UPDATE, or DELETE query. If the last query was invalid or the @@ -39,11 +45,51 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* create temp table */ +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); + +$query = "INSERT INTO temp.mycity SELECT * FROM hotel.city WHERE state LIKE ?"; + +/* prepare statement */ +if ($stmt = $maxdb->prepare($query)) { + + /* Bind variable for placeholder */ + $code = 'N%'; + $stmt->bind_param("s", $code); + + /* execute statement */ + $stmt->execute(); + + printf("rows inserted: %d\n", $stmt->affected_rows); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-param.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-stmt-bind-param"> <refnamediv> <refname>maxdb_stmt_bind_param</refname> + <refname>stmt->bind_param</refname> <refpurpose>Binds variables to a prepared statement as parameters</refpurpose> </refnamediv> <refsect1> @@ -12,15 +13,43 @@ <type>bool</type><methodname>maxdb_stmt_bind_param</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>types</parameter></methodparam> - <methodparam><type>mixed</type><parameter role="reference">var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam> + <methodparam><type>mixed</type><parameter>&amp;var1</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>&amp;...</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>bind_param</methodname> + <methodparam><type>array</type><parameter>types</parameter></methodparam> + <methodparam><type>mixed</type><parameter>&amp;var1</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>&amp;...</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_bind_param</function> is used to bind variables for the parameter markers in the SQL statement that was passed to <function>maxdb_prepare</function>. The string <parameter>types</parameter> contains one or more characters which specify - the types for the corresponding bind variables + the types for the corresponding bind variables. + </para> + <para> + Variables for SELECT INTO SQL statements can also be bound using <function>maxdb_stmt_bind_param</function>. + Parameters for database procedures can be bound using <function>maxdb_stmt_bind_param</function>. See the + examples how to use <function>maxdb_stmt_bind_param</function> in this cases. + </para> + <para> + If a variable bound as INTO variable to a SQL statement was used before, the content of this variable + is overwritten by the data of the SELECT INTO statement. A reference to this variable will be invalid after a call to + <function>maxdb_stmt_bind_param</function>. + </para> + <para> + For INOUT parameters of database procedures the content of the bound INOUT variable is overwritten by the output + value of the database procedure. A reference to this variable will be invalid after a call to + <function>maxdb_stmt_bind_param</function>. + </para> + <para> <table> <title>Type specification chars</title> <tgroup cols='2'> @@ -73,11 +102,52 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb('localhost', 'MONA', 'RED', 'DEMODB'); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query ("CREATE TABLE temp.mycity LIKE hotel.city"); +$maxdb->query ("INSERT INTO temp.mycity SELECT * FROM hotel.city"); + +$stmt = $maxdb->prepare("INSERT INTO temp.mycity VALUES (?, ?, ?)"); +$stmt->bind_param('sss', $zip, $name, $state); + +$zip = '11111'; +$name = 'Georgetown'; +$state = 'NY'; + +/* execute prepared statement */ +$stmt->execute(); + +printf("%d Row inserted.\n", $stmt->affected_rows); + +/* close statement and connection */ +$stmt->close(); + +/* Clean up table CountryLanguage */ +$maxdb->query("DELETE FROM temp.mycity WHERE name='Georgetown'"); +printf("%d Row deleted.\n", $maxdb->affected_rows); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { @@ -122,6 +192,91 @@ 1 Row deleted. ]]> </screen> + <example> + <title>Procedural style (SELECT INTO)</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (!$link) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* Performing SQL query */ +$stmt = maxdb_prepare ($link, "SELECT price INTO ? FROM hotel.room where hno = ? and type = ?"); +if (!$stmt) { + printf ("Prepare failed: %s\n", maxdb_error($link)); +} + +$hno = "50"; +$rtype = "suite"; + +maxdb_stmt_bind_param($stmt, 'dss', $price, $hno, $rtype); +maxdb_stmt_execute($stmt); + +printf ("%f\n", $price); + +maxdb_stmt_close ($stmt); +?> +]]> + </programlisting> + </example> + <para> + The above examples would produce the following output: + </para> + <screen> +<![CDATA[ +21.600000 +]]> + </screen> + <example> + <title>Procedural style (DB procedure)</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (!$link) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +maxdb_report (MAXDB_REPORT_OFF); +maxdb_query($link,"DROP DBPROC test_proc"); +maxdb_report (MAXDB_REPORT_ERROR); + +$query = "create dbproc test_proc (INOUT e_text char(72)) AS select * from SYSDBA.DUAL; fetch into :e_text;"; + +maxdb_query($link, $query); + +/* Performing SQL query */ +$stmt = maxdb_prepare ($link, "CALL test_proc (?)"); +if (!$stmt) { + printf ("Prepare failed: %s\n", maxdb_error($link)); +} + +maxdb_stmt_bind_param($stmt, 's', $result); +maxdb_stmt_execute($stmt); + +printf ("%s\n", $result); + +maxdb_stmt_close ($stmt); +?> +]]> + </programlisting> + </example> + <para> + The above examples would produce the following output: + </para> + <screen> +<![CDATA[ +a +]]> + </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-bind-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-stmt-bind-result"> <refnamediv> <refname>maxdb_stmt_bind_result</refname> + <refname>stmt->bind_result</refname> <refpurpose>Binds variables to a prepared statement for result storage</refpurpose> </refnamediv> <refsect1> @@ -11,9 +12,19 @@ <methodsynopsis> <type>bool</type><methodname>maxdb_stmt_bind_result</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> - <methodparam><type>mixed</type><parameter role="reference">var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam> + <methodparam><type>mixed</type><parameter>&amp;var1</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>&amp;...</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>bind_result</methodname> + <methodparam><type>mixed</type><parameter>&amp;var1</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>&amp;...</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_bind_result</function> is used to associate (bind) columns in the result set to variables. When <function>maxdb_stmt_fetch</function> is called to fetch data, the MaxDB @@ -53,11 +64,45 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* prepare statement */ +if ($stmt = $maxdb->prepare("SELECT zip, name FROM hotel.city ORDER BY name")) { + $stmt->execute(); + + /* bind variables to prepared statement */ + $stmt->bind_result($col1, $col2); + + /* fetch values */ + while ($stmt->fetch()) { + printf("%s %s\n", $col1, $col2); + } + + /* close statement */ + $stmt->close(); +} +/* close connection */ +$maxdb->close(); + +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml:1.2 Mon Jan 17 05:51:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-close-long-data.xml Tue Mar 8 11:39:06 2005 @@ -1,18 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-stmt-close-long-data"> <refnamediv> <refname>maxdb_stmt_close_long_data</refname> + <refname>stmt->close_long_data</refname> <refpurpose>Ends a sequence of <function>maxdb_stmt_send_long_data</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> - <type>bool</type><methodname>maxdb_stmt_close_long_data</methodname> + <type>bool</type><methodname>maxdb_stmt_send_long_data</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb_stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>maxdb_stmt->close_long_data</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> This function has to be called after a sequence of <function>maxdb_stmt_send_long_data</function>, that was started http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml:1.1.1.1 Wed Jan 12 13:53:15 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-close.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-close"> <refnamediv> <refname>maxdb_stmt_close</refname> + <refname>maxdb_stmt->close</refname> <refpurpose>Closes a prepared statement</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,14 @@ <type>bool</type><methodname>maxdb_stmt_close</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb_stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>maxdb_stmt->close</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> Closes a prepared statement. <function>maxdb_stmt_close</function> also deallocates the statement handle pointed to by <parameter>stmt</parameter>. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml:1.1.1.1 Wed Jan 12 13:53:16 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-data-seek.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-data-seek"> <refnamediv> <refname>maxdb_stmt_data_seek</refname> + <refname>stmt->data_seek</refname> <refpurpose>Seeks to an arbitray row in statement result set</refpurpose> </refnamediv> <refsect1> @@ -13,6 +14,15 @@ <methodparam><type>resource</type><parameter>statement</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>data_seek</methodname> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_stmt_data_seek</function> function seeks to an arbitrary result pointer specified by the <parameter>offset</parameter> in the statement result set represented by @@ -35,12 +45,56 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, zip FROM hotel.city ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* execute query */ + $stmt->execute(); + + /* bind result variables */ + $stmt->bind_result($name, $code); + + /* store result */ + $stmt->store_result(); + + /* seek to row no. 5 */ + $stmt->data_seek(5); + + /* fetch values */ + $stmt->fetch(); + + printf ("City: %s Zip: %s\n", $name, $code); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml:1.1.1.1 Wed Jan 12 13:53:16 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-errno.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-errno"> <refnamediv> <refname>maxdb_stmt_errno</refname> + <refname>maxdb_stmt->errno</refname> <refpurpose>Returns the error code for the most recent statement call</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_stmt_errno</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> + </classsynopsis> <para> For the statement specified by <literal>stmt</literal>, <function>maxdb_stmt_errno</function> returns the error code for the most recently invoked statement function that can succeed or fail. @@ -39,12 +45,51 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); +$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city"); + + +$query = "SELECT name, zip FROM temp.mycity ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* drop table */ + $maxdb->query("DROP TABLE temp.mycity"); + + /* execute query */ + $stmt->execute(); + + printf("Error: %d.\n", $stmt->errno); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml:1.1.1.1 Wed Jan 12 13:53:17 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-error.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-error"> <refnamediv> <refname>maxdb_stmt_error</refname> + <refname>maxdb_stmt->error</refname> <refpurpose>Returns a string description for last statement error</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>string</type><methodname>maxdb_stmt_error</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> + </classsynopsis> <para> For the statement specified by <literal>stmt</literal>, <function>maxdb_stmt_error</function> returns a containing the error message for the most recently invoked statement function that @@ -34,12 +40,51 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); +$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city"); + + +$query = "SELECT name, zip FROM temp.mycity ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* drop table */ + $maxdb->query("DROP TABLE temp.mycity"); + + /* execute query */ + $stmt->execute(); + + printf("Error: %s.\n", $stmt->error); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml:1.1.1.1 Wed Jan 12 13:53:18 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-execute.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-execute"> <refnamediv> <refname>maxdb_stmt_execute</refname> + <refname>stmt->execute</refname> <refpurpose>Executes a prepared Query</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>bool</type><methodname>maxdb_stmt_execute</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>execute</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_stmt_execute</function> function executes a query that has been previously prepared using the <function>maxdb_prepare</function> function represented by the @@ -44,11 +54,68 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); + +/* Prepare an insert statement */ +$query = "INSERT INTO temp.mycity (zip, name, state) VALUES (?,?,?)"; +$stmt = $maxdb->prepare($query); + +$stmt->bind_param("sss", $val1, $val2, $val3); + +$val1 = '11111'; +$val2 = 'Georgetown'; +$val3 = 'NY'; + +/* Execute the statement */ +$stmt->execute(); + +$val1 = '22222'; +$val2 = 'Hubbatown'; +$val3 = 'CA'; + +/* Execute the statement */ +$stmt->execute(); + +/* close statement */ +$stmt->close(); + +/* retrieve all rows from myCity */ +$query = "SELECT zip, name, state FROM temp.mycity"; +if ($result = $maxdb->query($query)) { + while ($row = $result->fetch_row()) { + printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); + } + /* free result set */ + $result->close(); +} + +/* remove table */ +$maxdb->query("DROP TABLE temp.mycity"); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml:1.1.1.1 Wed Jan 12 13:53:18 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-fetch.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-fetch"> <refnamediv> <refname>maxdb_stmt_fetch</refname> + <refname>stmt->fetch</refname> <refpurpose> Fetch results from a prepared statement into the bound variables </refpurpose> @@ -14,6 +15,15 @@ <type>mixed</type><methodname>maxdb_stmt_fetch</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>fetch</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_fetch</function> returns row data using the variables bound by <function>maxdb_stmt_bind_result</function>. </para> @@ -63,11 +73,49 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT zip, name FROM hotel.city ORDER by name"; + +if ($stmt = $maxdb->prepare($query)) { + + /* execute statement */ + $stmt->execute(); + + /* bind result variables */ + $stmt->bind_result($name, $code); + + /* fetch values */ + while ($stmt->fetch()) { + printf ("%s (%s)\n", $name, $code); + } + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml:1.1.1.1 Wed Jan 12 13:53:18 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-free-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-free-result"> <refnamediv> <refname>maxdb_stmt_free_result</refname> + <refname>stmt->free_result</refname> <refpurpose>Frees stored result memory for the given statement handle</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>void</type><methodname>maxdb_stmt_free_result</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>void</type> + <methodname>free_result</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> The <function>maxdb_stmt_free_result</function> function frees the result memory associated with the statement represented by the http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml:1.1.1.1 Wed Jan 12 13:53:19 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-init.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-init"> <refnamediv> <refname>maxdb_stmt_init</refname> + <refname>maxdb->stmt_init</refname> <refpurpose> Initializes a statement and returns an resource for use with maxdb_stmt_prepare </refpurpose> @@ -14,6 +15,15 @@ <type>resource</type><methodname>maxdb_stmt_init</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>object</type> + <methodname>stmt_init</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> Allocates and initializes a statement resource suitable for <function>maxdb_stmt_prepare</function>. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml:1.1.1.1 Wed Jan 12 13:53:19 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-num-rows.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-num-rows"> <refnamediv> <refname>maxdb_stmt_num_rows</refname> + <refname>stmt->num_rows</refname> <refpurpose>Return the number of rows in statements result set</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>mixed</type><methodname>maxdb_stmt_num_rows</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <fieldsynopsis><type>int</type><varname>num_rows</varname></fieldsynopsis> + </classsynopsis> <para> Returns the number of rows in the result set. </para> @@ -33,12 +39,47 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT zip, name FROM hotel.city ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* execute query */ + $stmt->execute(); + + /* store result */ + $stmt->store_result(); + + printf("Number of rows: %d.\n", $stmt->num_rows); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { @@ -72,7 +113,7 @@ </para> <screen> <![CDATA[ -Number of rows: -1. +Number of rows: 25. ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml:1.1.1.1 Wed Jan 12 13:53:20 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-param-count.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-param-count"> <refnamediv> <refname>maxdb_stmt_param_count</refname> + <refname>stmt->param_count</refname> <refpurpose>Returns the number of parameter for the given statement</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_stmt_param_count</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <fieldsynopsis><type>int</type><varname>param_count</varname></fieldsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_param_count</function> returns the number of parameter markers present in the prepared statement. @@ -32,11 +38,39 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +if ($stmt = $maxdb->prepare("SELECT name FROM hotel.city WHERE name=? OR state=?")) { + + $marker = $stmt->param_count; + printf("Statement has %d markers.\n", $marker); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml:1.1.1.1 Wed Jan 12 13:53:20 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-prepare.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-prepare"> <refnamediv> <refname>maxdb_stmt_prepare</refname> + <refname>stmt->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> @@ -15,6 +16,15 @@ <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>prepare</methodname> + <methodparam><type>string</type><parameter>query</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_prepare</function> prepares the SQL query pointed to by the null-terminated string query. The statement resource has to be allocated by @@ -75,11 +85,54 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$city = "Portland"; + +/* create a prepared statement */ +$stmt = $maxdb->stmt_init(); +if ($stmt->prepare("SELECT state FROM hotel.city WHERE name=?")) { + + /* bind parameters for markers */ + $stmt->bind_param("s", $city); + + /* execute query */ + $stmt->execute(); + + /* bind result variables */ + $stmt->bind_result($district); + + /* fetch value */ + $stmt->fetch(); + + printf("%s is in district %s\n", $city, $district); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml:1.1.1.1 Wed Jan 12 13:53:21 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-reset.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-reset"> <refnamediv> <refname>maxdb_stmt_reset</refname> + <refname>stmt->reset</refname> <refpurpose>Resets a prepared statement</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>bool</type><methodname>maxdb_stmt_reset</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>reset</methodname> + <void /> + </methodsynopsis> + </classsynopsis> &warn.experimental.func; http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml:1.1.1.1 Wed Jan 12 13:53:21 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-result-metadata.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-result-metadata"> <refnamediv> <refname>maxdb_stmt_result_metadata</refname> @@ -12,6 +12,15 @@ <type>mixed</type><methodname>maxdb_stmt_result_metadata</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>result_metadata</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> If a statement passed to <function>maxdb_prepare</function> is one that produces a result set, <function>maxdb_stmt_result_metadata</function> returns the result resource @@ -63,11 +72,43 @@ <title>Example</title> <para> <example> + <title>Object oriented style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +$maxdb->query("CREATE TABLE temp.friends (id int, name varchar(20))"); + +$maxdb->query("INSERT INTO temp.friends VALUES (1,'Hartmut')"); +$maxdb->query("INSERT INTO temp.friends VALUES (2, 'Ulf')"); + +$stmt = $maxdb->prepare("SELECT id, name FROM temp.friends"); +$stmt->execute(); + +/* get resultset for metadata */ +$result = $stmt->result_metadata(); + +/* retrieve field information from metadata result set */ +$field = $result->fetch_field(); + +printf("Fieldname: %s\n", $field->name); + +/* close resultset */ +$result->close(); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); maxdb_query($link, "CREATE TABLE temp.friends (id int, name varchar(20))"); http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml:1.2 phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml:1.3 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml:1.2 Sun Feb 13 23:13:15 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-send-long-data.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.maxdb-stmt-send-long-data"> <refnamediv> <refname>maxdb_stmt_send_long_data</refname> + <refname>stmt->send_long_data</refname> <refpurpose>Send data in blocks</refpurpose> </refnamediv> <refsect1> @@ -14,6 +15,15 @@ <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method)</para> + <classsynopsis> + <ooclass><classname>stmt</classname></ooclass> + <methodsynopsis> + <type>bool</type><methodname>stmt_send_long_data</methodname> + <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> + <methodparam><type>string</type><parameter>data</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Allows to send parameter data to the server in pieces (or chunks). This function can be called multiple times to send the parts of a character or @@ -26,7 +36,7 @@ </para> <note> <para> - For efficiency reasons, this function should be used after calling + For efficency reasons, this function should be used after calling <function>maxdb_execute</function>. In this case, the data is not stored on the client side. The end of the sequence must end with a call to <function>maxdb_stmt_close_long_data</function>. http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml:1.1.1.1 Wed Jan 12 13:53:22 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-sqlstate.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-sqlstate"> <refnamediv> <refname>maxdb_stmt_sqlstate</refname> @@ -41,12 +41,50 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); +$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city"); + +$query = "SELECT name, zip FROM temp.mycity ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* drop table */ + $maxdb->query("DROP TABLE temp.mycity"); + + /* execute query */ + $stmt->execute(); + + printf("Error: %s.\n", $stmt->sqlstate); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml:1.1.1.1 Wed Jan 12 13:53:23 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-stmt-store-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-stmt-store-result"> <refnamediv> <refname>maxdb_stmt_store_result</refname> + <refname>maxdb->store_result</refname> <refpurpose>Transfers a result set from a prepared statement</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>bool</type><methodname>maxdb_stmt_store_result</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>object</type> + <methodname>store_result</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_stmt_store_result</function> has no functionally effect and should not be used for retrieving data from MaxDB server. @@ -32,12 +42,50 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* Open a connection */ +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT name, zip FROM hotel.city ORDER BY name"; +if ($stmt = $maxdb->prepare($query)) { + + /* execute query */ + $stmt->execute(); + + /* store result */ + $stmt->store_result(); + + printf("Number of rows: %d.\n", $stmt->num_rows); + + /* free result */ + $stmt->free_result(); + + /* close statement */ + $stmt->close(); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { @@ -74,7 +122,7 @@ </para> <screen> <![CDATA[ -Number of rows: -1. +Number of rows: 25. ]]> </screen> </refsect1> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml:1.1.1.1 Wed Jan 12 13:53:23 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-store-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-store-result"> <refnamediv> <refname>maxdb_store_result</refname> + <refname>maxdb->store_result</refname> <refpurpose>Transfers a result set from the last query</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>resource</type><methodname>maxdb_store_result</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>object</type> + <methodname>store_result</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> This function has no functionally effect. </para> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml:1.1.1.1 Wed Jan 12 13:53:24 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-thread-id.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-thread-id"> <refnamediv> <refname>maxdb_thread_id</refname> + <refname>maxdb->thread_id</refname> <refpurpose>Returns the thread ID for the current connection</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_thread_id</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>int</type><varname>thread_id</varname></fieldsynopsis> + </classsynopsis> <para> The <function>maxdb_thread_id</function> function returns the thread ID for the current connection which can then be killed using the @@ -42,11 +48,42 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +/* determine our thread id */ +$thread_id = $maxdb->thread_id; + +/* Kill connection */ +$maxdb->kill($thread_id); + +/* This should produce an error */ +if (!$maxdb->query("CREATE TABLE mycity LIKE hotel.city")) { + printf("Error: %s\n", $maxdb->error); + exit; +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml:1.1.1.1 Wed Jan 12 13:53:24 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-thread-safe.xml Tue Mar 8 11:39:06 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-thread-safe"> <refnamediv> <refname>maxdb_thread_safe</refname> http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml:1.1.1.1 Wed Jan 12 13:53:24 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-use-result.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-use-result"> <refnamediv> <refname>maxdb_use_result</refname> + <refname>maxdb->use_result</refname> <refpurpose>Initiate a result set retrieval</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,15 @@ <type>mixed</type><methodname>maxdb_use_result</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (method):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <methodsynopsis> + <type>mixed</type> + <methodname>use_result</methodname> + <void /> + </methodsynopsis> + </classsynopsis> <para> <function>maxdb_use_result</function> has no effect. </para> @@ -32,11 +42,50 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$query = "SELECT * FROM DUAL;"; +$query .= "SELECT name FROM hotel.city"; + +/* execute multi query */ +if ($maxdb->multi_query($query)) { + do { + /* store first result set */ + if ($result = $maxdb->use_result()) { + while ($row = $result->fetch_row()) { + printf("%s\n", $row[0]); + } + $result->close(); + } + /* print divider */ + if ($maxdb->more_results()) { + printf("-----------------\n"); + } + } while ($maxdb->next_result()); +} + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { http://cvs.php.net/diff.php/phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml?r1=1.1.1.1&r2=1.2&ty=u Index: phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml diff -u phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml:1.1.1.1 phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml:1.2 --- phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml:1.1.1.1 Wed Jan 12 13:53:25 2005 +++ phpdoc/en/reference/maxdb/functions/maxdb-warning-count.xml Tue Mar 8 11:39:06 2005 @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1.1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.maxdb-warning-count"> <refnamediv> <refname>maxdb_warning_count</refname> + <refname>maxdb->warning_count</refname> <refpurpose>Returns the number of warnings from the last query for the given link</refpurpose> </refnamediv> <refsect1> @@ -12,6 +13,11 @@ <type>int</type><methodname>maxdb_warning_count</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> + <para>Object oriented style (property):</para> + <classsynopsis> + <ooclass><classname>maxdb</classname></ooclass> + <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> + </classsynopsis> <para> <function>maxdb_warning_count</function> returns the number of warnings from the last query in the connection represented by the @@ -35,11 +41,40 @@ <refsect1> <title>Example</title> <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); + +/* check connection */ +if (maxdb_connect_errno()) { + printf("Connect failed: %s\n", maxdb_connect_error()); + exit(); +} + +$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); + +/* a remarkable city in Wales */ +$query = "INSERT INTO temp.mycity (zip, name) VALUES('11111', + 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; + +$maxdb->query($query); + +printf ("Number of warning: %d\n", $maxdb->warning_count); + +/* close connection */ +$maxdb->close(); +?> +]]> + </programlisting> + </example> + <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php -$link = maxdb_connect("localhost", "MONA", "RED"); +$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) {
« previous php.doc (#969366900) next »