mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@95451 c90b9560-bf6c-de11-be94-00142212c4b1
1109 lines
36 KiB
XML
1109 lines
36 KiB
XML
<!-- D O N O T E D I T T H I S F I L E ! ! !
|
|
|
|
it is still here for historical reasons only
|
|
(as translators may need to check old revision diffs)
|
|
|
|
if you want to change things documented in this file
|
|
you should now edit the files found under en/reference
|
|
instead -->
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.28 $ -->
|
|
<reference id="ref.msql">
|
|
<title>mSQL functions</title>
|
|
<titleabbrev>mSQL</titleabbrev>
|
|
<partintro>
|
|
<simpara>
|
|
These functions allow you to access mSQL database servers. In
|
|
order to have these functions available, you must compile php
|
|
with msql support by using the
|
|
<option role="configure">--with-msql[=dir]</option> option. The default
|
|
location is /usr/local/Hughes.
|
|
</simpara>
|
|
<simpara>
|
|
More information about mSQL can be found at <ulink
|
|
url="&url.msql;">&url.msql;</ulink>.
|
|
</simpara>
|
|
</partintro>
|
|
|
|
<refentry id="function.msql">
|
|
<refnamediv>
|
|
<refname>msql</refname>
|
|
<refpurpose>Send mSQL query</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql</methodname>
|
|
<methodparam><type>string</type><parameter>database</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns a positive mSQL query identifier to the query result, or
|
|
&false; on error.
|
|
</para>
|
|
<para>
|
|
<function>msql</function> selects a database and executes a query
|
|
on it. If the optional link identifier isn't specified, the
|
|
function will try to find an open link to the mSQL server and if
|
|
no such link is found it'll try to create one as if
|
|
<function>msql_connect</function> was called with no arguments
|
|
(see <function>msql_connect</function>).
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-affected-rows">
|
|
<refnamediv>
|
|
<refname>msql_affected_rows</refname>
|
|
<refpurpose>Returns number of affected rows</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_affected_rows</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns number of affected ("touched") rows by a specific query
|
|
(i.e. the number of rows returned by a SELECT, the number of rows
|
|
modified by an update, or the number of rows removed by a
|
|
delete).
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_query</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-close">
|
|
<refnamediv>
|
|
<refname>msql_close</refname>
|
|
<refpurpose>Close mSQL connection</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_close</methodname>
|
|
<methodparam><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; on success, &false; on error.
|
|
</para>
|
|
<para>
|
|
<function>msql_close</function> closes the link to a mSQL
|
|
database that's associated with the specified link identifier.
|
|
If the link identifier isn't specified, the last opened link is
|
|
assumed.
|
|
</para>
|
|
<para>
|
|
Note that this isn't usually necessary, as non-persistent open
|
|
links are automatically closed at the end of the script's
|
|
execution.
|
|
</para>
|
|
<para>
|
|
<function>msql_close</function> will not close persistent links
|
|
generated by <function>msql_pconnect</function>.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_connect</function> and
|
|
<function>msql_pconnect</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-connect">
|
|
<refnamediv>
|
|
<refname>msql_connect</refname>
|
|
<refpurpose>Open mSQL connection</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_connect</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
server
|
|
</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
username
|
|
</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
password
|
|
</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns a positive mSQL link identifier on success, or &false; on
|
|
error.
|
|
</para>
|
|
<para>
|
|
<function>msql_connect</function> establishes a connection to a
|
|
mSQL server. The <parameter>server</parameter> parameter is a hostname
|
|
or IP address, and can optionally include a port number after a single
|
|
colon. eg. "192.168.0.2:4322". It defaults to 'localhost' and
|
|
port '4333' if the argument is not set.
|
|
</para>
|
|
<para>
|
|
In case a second call is made to
|
|
<function>msql_connect</function> with the same arguments, no new
|
|
link will be established, but instead, the link identifier of the
|
|
already opened link will be returned.
|
|
</para>
|
|
<para>
|
|
The link to the server will be closed as soon as the execution of
|
|
the script ends, unless it's closed earlier by explicitly calling
|
|
<function>msql_close</function>.
|
|
</para>
|
|
<para>
|
|
See also <function>msql_pconnect</function>,
|
|
<function>msql_close</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-create-db">
|
|
<refnamediv>
|
|
<refname>msql_create_db</refname>
|
|
<refpurpose>Create mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_create_db</methodname>
|
|
<methodparam><type>string</type><parameter>database name</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
msql_create_db() attempts to create a new database on the server
|
|
associated with the specified link identifier.
|
|
</para>
|
|
<para> See also: <function>msql_drop_db</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-createdb">
|
|
<refnamediv>
|
|
<refname>msql_createdb</refname>
|
|
<refpurpose>Create mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_createdb</methodname>
|
|
<methodparam><type>string</type><parameter>database name</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Identical to <function>msql_create_db</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-data-seek">
|
|
<refnamediv>
|
|
<refname>msql_data_seek</refname>
|
|
<refpurpose>Move internal row pointer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_data_seek</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<function>msql_data_seek</function> moves the internal row
|
|
pointer of the mSQL result associated with the specified query
|
|
identifier to pointer to the specifyed row number. The next call
|
|
to <function>msql_fetch_row</function> would return that
|
|
row.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_fetch_row</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-dbname">
|
|
<refnamediv>
|
|
<refname>msql_dbname</refname>
|
|
<refpurpose>Get current mSQL database name</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_dbname</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>i</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_dbname</function> returns the database name stored
|
|
in position <parameter>i</parameter> of the result pointer
|
|
returned from the <function>msql_listdbs</function> function. The
|
|
<function>msql_numrows</function> function can be used to
|
|
determine how many database names are available.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-drop-db">
|
|
<refnamediv>
|
|
<refname>msql_drop_db</refname>
|
|
<refpurpose>Drop (delete) mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_drop_db</methodname>
|
|
<methodparam><type>string</type><parameter>database_name</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<function>msql_drop_db</function> attempts to drop (remove) an
|
|
entire database from the server associated with the specified
|
|
link identifier.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_create_db</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-dropdb">
|
|
<refnamediv>
|
|
<refname>msql_dropdb</refname>
|
|
<refpurpose>Drop (delete) mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
See <function>msql_drop_db</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-error">
|
|
<refnamediv>
|
|
<refname>msql_error</refname>
|
|
<refpurpose>Returns error message of last msql call</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_error</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Errors coming back from the mSQL database backend no longer
|
|
issue warnings. Instead, use these functions to retrieve the
|
|
error string.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fetch-array">
|
|
<refnamediv>
|
|
<refname>msql_fetch_array</refname>
|
|
<refpurpose>Fetch row as array</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_fetch_array</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns an array that corresponds to the fetched row, or &false; if
|
|
there are no more rows.
|
|
</para>
|
|
<para>
|
|
<function>msql_fetch_array</function> is an extended version of
|
|
<function>msql_fetch_row</function>. In addition to storing the
|
|
data in the numeric indices of the result array, it also stores
|
|
the data in associative indices, using the field names as keys.
|
|
</para>
|
|
<para>
|
|
The second optional argument <parameter>result_type</parameter>
|
|
in <function>msql_fetch_array</function> is a constant and can
|
|
take the following values: MSQL_ASSOC, MSQL_NUM, and MSQL_BOTH.
|
|
</para>
|
|
<para>
|
|
Be careful if you are retrieving results from a query that may
|
|
return a record that contains only one field that has a value of
|
|
0 (or an empty string, or &null;).
|
|
</para>
|
|
<para>
|
|
An important thing to note is that using
|
|
<function>msql_fetch_array</function> is NOT significantly slower
|
|
than using <function>msql_fetch_row</function>, while it provides
|
|
a significant added value.
|
|
</para>
|
|
<para>
|
|
For further details, also see
|
|
<function>msql_fetch_row</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fetch-field">
|
|
<refnamediv>
|
|
<refname>msql_fetch_field</refname>
|
|
<refpurpose>Get field information</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>msql_fetch_field</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns an object containing field information
|
|
</para>
|
|
<para>
|
|
<function>msql_fetch_field</function> can be used in order to
|
|
obtain information about fields in a certain query result. If
|
|
the field offset isn't specified, the next field that wasn't yet
|
|
retreived by <function>msql_fetch_field</function> is retreived.
|
|
</para>
|
|
<para>
|
|
The properties of the object are:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
name - column name
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
table - name of the table the column belongs to
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
not_null - 1 if the column cannot be &null;
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
primary_key - 1 if the column is a primary key
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
unique - 1 if the column is a unique key
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
type - the type of the column
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
See also <function>msql_field_seek</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fetch-object">
|
|
<refnamediv>
|
|
<refname>msql_fetch_object</refname>
|
|
<refpurpose>Fetch row as object</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_fetch_object</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns an object with properties that correspond to the fetched
|
|
row, or &false; if there are no more rows.
|
|
</para>
|
|
<para>
|
|
<function>msql_fetch_object</function> is similar to
|
|
<function>msql_fetch_array</function>, with one difference - an
|
|
object is returned, instead of an array. Indirectly, that means
|
|
that you can only access the data by the field names, and not by
|
|
their offsets (numbers are illegal property names).
|
|
</para>
|
|
<para>
|
|
The optional second argument <parameter>result_type</parameter>
|
|
in <function>msql_fetch_array</function> is a constant and can
|
|
take the following values: MSQL_ASSOC, MSQL_NUM, and MSQL_BOTH.
|
|
</para>
|
|
<para>
|
|
Speed-wise, the function is identical to
|
|
<function>msql_fetch_array</function>, and almost as quick as
|
|
<function>msql_fetch_row</function> (the difference is
|
|
insignificant).
|
|
</para>
|
|
<para> See also:
|
|
<function>msql_fetch_array</function> and
|
|
<function>msql_fetch_row</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fetch-row">
|
|
<refnamediv>
|
|
<refname>msql_fetch_row</refname>
|
|
<refpurpose>Get row as enumerated array</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>msql_fetch_row</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns an array that corresponds to the fetched row, or &false; if
|
|
there are no more rows.
|
|
</para>
|
|
<para>
|
|
<function>msql_fetch_row</function> fetches one row of data from
|
|
the result associated with the specified query identifier. The
|
|
row is returned as an array. Each result column is stored in an
|
|
array offset, starting at offset 0.
|
|
</para>
|
|
<para>
|
|
Subsequent call to <function>msql_fetch_row</function> would
|
|
return the next row in the result set, or &false; if there are no
|
|
more rows.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_fetch_array</function>,
|
|
<function>msql_fetch_object</function>,
|
|
<function>msql_data_seek</function>, and
|
|
<function>msql_result</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fieldname">
|
|
<refnamediv>
|
|
<refname>msql_fieldname</refname>
|
|
<refpurpose>Get field name</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_fieldname</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_fieldname</function> returns the name of the
|
|
specified field. <parameter>query_identifier</parameter> is the
|
|
query identifier, and <parameter>field</parameter> is the field
|
|
index. <literal>msql_fieldname($result, 2);</literal> will
|
|
return the name of the second field in the result associated with
|
|
the result identifier.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-field-seek">
|
|
<refnamediv>
|
|
<refname>msql_field_seek</refname>
|
|
<refpurpose>Set field offset</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_field_seek</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Seeks to the specified field offset. If the next call to
|
|
<function>msql_fetch_field</function> won't include a field
|
|
offset, this field would be returned.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_fetch_field</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fieldtable">
|
|
<refnamediv>
|
|
<refname>msql_fieldtable</refname>
|
|
<refpurpose>Get table name for field</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_fieldtable</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns the name of the table <parameter>field</parameter> was
|
|
fetched from.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fieldtype">
|
|
<refnamediv>
|
|
<refname>msql_fieldtype</refname>
|
|
<refpurpose>Get field type</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_fieldtype</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>i</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_fieldtype</function> is similar to the
|
|
<function>msql_fieldname</function> function. The arguments are
|
|
identical, but the field type is returned. This will be one of
|
|
"int", "char" or "real".
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fieldflags">
|
|
<refnamediv>
|
|
<refname>msql_fieldflags</refname>
|
|
<refpurpose>Get field flags</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_fieldflags</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>i</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_fieldflags</function> returns the field flags of
|
|
the specified field. Currently this is either, "not &null;",
|
|
"primary key", a combination of the two or "" (an empty string).
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-fieldlen">
|
|
<refnamediv>
|
|
<refname>msql_fieldlen</refname>
|
|
<refpurpose>Get field length</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_fieldlen</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>i</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_fieldlen</function> returns the length of the
|
|
specified field.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-free-result">
|
|
<refnamediv>
|
|
<refname>msql_free_result</refname>
|
|
<refpurpose>Free result memory</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_free_result</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_free_result</function> frees the memory associated
|
|
with <parameter>query_identifier</parameter>. When PHP completes a
|
|
request, this memory is freed automatically, so you only need to
|
|
call this function when you want to make sure you don't use too
|
|
much memory while the script is running.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-freeresult">
|
|
<refnamediv>
|
|
<refname>msql_freeresult</refname>
|
|
<refpurpose>Free result memory</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>See <function>msql_free_result</function></para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
|
|
<refentry id="function.msql-list-fields">
|
|
<refnamediv>
|
|
<refname>msql_list_fields</refname>
|
|
<refpurpose>List result fields</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_list_fields</methodname>
|
|
<methodparam><type>string</type><parameter>database</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>tablename</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_list_fields</function> retrieves information about
|
|
the given tablename. Arguments are the database name and the
|
|
table name. A result pointer is returned which can be used with
|
|
<function>msql_fieldflags</function>,
|
|
<function>msql_fieldlen</function>,
|
|
<function>msql_fieldname</function>, and
|
|
<function>msql_fieldtype</function>. A query identifier is a
|
|
positive integer. The function returns <literal>-1</literal> if a
|
|
error occurs. A string describing the error will be placed in
|
|
<literal>$phperrmsg</literal>, and unless the function was called
|
|
as <literal>@msql_list_fields()</literal> then this error string
|
|
will also be printed out.
|
|
</para>
|
|
<para>
|
|
See also <function>msql_error</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-listfields">
|
|
<refnamediv>
|
|
<refname>msql_listfields</refname>
|
|
<refpurpose>List result fields</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
See <function>msql_list_fields</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-list-dbs">
|
|
<refnamediv>
|
|
<refname>msql_list_dbs</refname>
|
|
<refpurpose>List mSQL databases on server</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_list_dbs</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_list_dbs</function> will return a result pointer
|
|
containing the databases available from the current msql
|
|
daemon. Use the <function>msql_dbname</function> function to
|
|
traverse this result pointer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-listdbs">
|
|
<refnamediv>
|
|
<refname>msql_listdbs</refname>
|
|
<refpurpose>List mSQL databases on server</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
See <function>msql_list_dbs</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-list-tables">
|
|
<refnamediv>
|
|
<refname>msql_list_tables</refname>
|
|
<refpurpose>List tables in an mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_list_tables</methodname>
|
|
<methodparam><type>string</type><parameter>database</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_list_tables</function> takes a database name and
|
|
result pointer much like the <function>msql</function>
|
|
function. The <function>msql_tablename</function> function should
|
|
be used to extract the actual table names from the result
|
|
pointer.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-listtables">
|
|
<refnamediv>
|
|
<refname>msql_listtables</refname>
|
|
<refpurpose>List tables in an mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
See <function>msql_list_tables</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-num-fields">
|
|
<refnamediv>
|
|
<refname>msql_num_fields</refname>
|
|
<refpurpose>Get number of fields in result</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_num_fields</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_num_fields</function> returns the number of fields
|
|
in a result set.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql</function>,
|
|
<function>msql_query</function>,
|
|
<function>msql_fetch_field</function>, and
|
|
<function>msql_num_rows</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-num-rows">
|
|
<refnamediv>
|
|
<refname>msql_num_rows</refname>
|
|
<refpurpose>Get number of rows in result</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_num_rows</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_num_rows</function> returns the number of rows in
|
|
a result set.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql</function>,
|
|
<function>msql_query</function>, and
|
|
<function>msql_fetch_row</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-numfields">
|
|
<refnamediv>
|
|
<refname>msql_numfields</refname>
|
|
<refpurpose>Get number of fields in result</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_numfields</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Identical to <function>msql_num_fields</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-numrows">
|
|
<refnamediv>
|
|
<refname>msql_numrows</refname>
|
|
<refpurpose>Get number of rows in result</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_numrows</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Identical to <function>msql_num_rows</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-pconnect">
|
|
<refnamediv>
|
|
<refname>msql_pconnect</refname>
|
|
<refpurpose>Open persistent mSQL connection</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_pconnect</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
server
|
|
</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
username
|
|
</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>
|
|
password
|
|
</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns a positive mSQL persistent link identifier on success, or
|
|
&false; on error.
|
|
</para>
|
|
<para>
|
|
<function>msql_pconnect</function> acts very much like
|
|
<function>msql_connect</function> with two major differences.
|
|
</para>
|
|
<para>
|
|
First, when connecting, the function would first try to
|
|
find a (persistent) link that's already open with the same host.
|
|
If one is found, an identifier for it will be returned instead of
|
|
opening a new connection.
|
|
</para>
|
|
<para>
|
|
Second, the connection to the SQL server will not be closed when
|
|
the execution of the script ends. Instead, the link will remain
|
|
open for future use (<function>msql_close</function> will not
|
|
close links established by <function>msql_pconnect</function>).
|
|
</para>
|
|
<para>
|
|
This type of links is therefore called 'persistent'.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-query">
|
|
<refnamediv>
|
|
<refname>msql_query</refname>
|
|
<refpurpose>Send mSQL query</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_query</methodname>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_query</function> sends a query to the currently
|
|
active database on the server that's associated with the
|
|
specified link identifier. If the link identifier isn't
|
|
specified, the last opened link is assumed. If no link is open,
|
|
the function tries to establish a link as if
|
|
<function>msql_connect</function> was called, and use it.
|
|
</para>
|
|
<para>
|
|
Returns a positive mSQL query identifier on success, or &false; on
|
|
error.
|
|
</para>
|
|
<example>
|
|
<title><function>msql_query</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$link = msql_connect("dbserver")
|
|
or die("unable to connect to msql server: ".msql_error());
|
|
msql_select_db("db", $link)
|
|
or die("unable to select database 'db': ".msql_error());
|
|
|
|
$result = msql_query("SELECT * FROM table WHERE id=1", $link);
|
|
if (!$result) {
|
|
die("query failed: ".msql_error());
|
|
}
|
|
|
|
while ($row = msql_fetch_array($result)) {
|
|
echo $row["id"];
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<para>
|
|
See also: <function>msql</function>,
|
|
<function>msql_select_db</function>, and
|
|
<function>msql_connect</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-regcase">
|
|
<refnamediv>
|
|
<refname>msql_regcase</refname>
|
|
<refpurpose>
|
|
Make regular expression for case insensitive match
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>See <function>sql_regcase</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-result">
|
|
<refnamediv>
|
|
<refname>msql_result</refname>
|
|
<refpurpose>Get result data</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_result</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>i</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>field</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns the contents of the cell at the row and offset in the
|
|
specified mSQL result set.
|
|
</para>
|
|
<para>
|
|
<function>msql_result</function> returns the contents of one cell
|
|
from a mSQL result set. The field argument can be the field's
|
|
offset, or the field's name, or the field's table dot field's
|
|
name (fieldname.tablename). If the column name has been aliased
|
|
('select foo as bar from ...'), use the alias instead of the
|
|
column name.
|
|
</para>
|
|
<para>
|
|
When working on large result sets, you should consider using one
|
|
of the functions that fetch an entire row (specified below). As
|
|
these functions return the contents of multiple cells in one
|
|
function call, they're MUCH quicker than
|
|
<function>msql_result</function>. Also, note that specifying a
|
|
numeric offset for the field argument is much quicker than
|
|
specifying a fieldname or tablename.fieldname argument.
|
|
</para>
|
|
<para>
|
|
Recommended high-performance alternatives:
|
|
<function>msql_fetch_row</function>,
|
|
<function>msql_fetch_array</function>, and
|
|
<function>msql_fetch_object</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-select-db">
|
|
<refnamediv>
|
|
<refname>msql_select_db</refname>
|
|
<refpurpose>Select mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>msql_select_db</methodname>
|
|
<methodparam><type>string</type><parameter>database_name</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>link_identifier</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; on success, &false; on error.
|
|
</para>
|
|
<para>
|
|
<function>msql_select_db</function> sets the current active
|
|
database on the server that's associated with the specified link
|
|
identifier. If no link identifier is specified, the last opened
|
|
link is assumed. If no link is open, the function will try to
|
|
establish a link as if <function>msql_connect</function> was
|
|
called, and use it.
|
|
</para>
|
|
<para>
|
|
Every subsequent call to <function>msql_query</function> will be
|
|
made on the active database.
|
|
</para>
|
|
<para>
|
|
See also: <function>msql_connect</function>,
|
|
<function>msql_pconnect</function>, and
|
|
<function>msql_query</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-selectdb">
|
|
<refnamediv>
|
|
<refname>msql_selectdb</refname>
|
|
<refpurpose>Select mSQL database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>See <function>msql_select_db</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.msql-tablename">
|
|
<refnamediv>
|
|
<refname>msql_tablename</refname>
|
|
<refpurpose>Get table name of field</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>msql_tablename</methodname>
|
|
<methodparam><type>int</type><parameter>query_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>msql_tablename</function> takes a result pointer
|
|
returned by the <function>msql_list_tables</function> function as
|
|
well as an integer index and returns the name of a table. The
|
|
<function>msql_numrows</function> function may be used to
|
|
determine the number of tables in the result pointer.
|
|
<example>
|
|
<title><function>msql_tablename</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
msql_connect ("localhost");
|
|
$result = msql_list_tables ("wisconsin");
|
|
$i = 0;
|
|
while ($i < msql_numrows ($result)) {
|
|
$tb_names[$i] = msql_tablename ($result, $i);
|
|
echo $tb_names[$i] . "<BR>";
|
|
$i++;
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|