mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Trailing spaces, tabs
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@67822 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
441f777f94
commit
e889596dc3
1 changed files with 156 additions and 156 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.82 $ -->
|
||||
<!-- $Revision: 1.83 $ -->
|
||||
<reference id="ref.mysql">
|
||||
<title>MySQL Functions</title>
|
||||
<titleabbrev>MySQL</titleabbrev>
|
||||
|
@ -27,7 +27,7 @@
|
|||
url="&url.mysql.docs;">&url.mysql.docs;</ulink>.
|
||||
</simpara>
|
||||
<para>
|
||||
The behaviour of the MySQL functions is affected by settings in the global
|
||||
The behaviour of the MySQL functions is affected by settings in the global
|
||||
<link linkend="configuration">configuration</link> file.
|
||||
<table>
|
||||
<title><link linkend="ini.sect.mysql">MySQL Configuration </link> Options</title>
|
||||
|
@ -122,7 +122,7 @@ mysql_close($link);
|
|||
|
||||
<refentry id="function.mysql-affected-rows">
|
||||
<refnamediv>
|
||||
<refname>mysql_affected_rows</refname>
|
||||
<refname>mysql_affected_rows</refname>
|
||||
<refpurpose>Get number of affected rows in previous MySQL
|
||||
operation</refpurpose>
|
||||
</refnamediv>
|
||||
|
@ -131,14 +131,14 @@ mysql_close($link);
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>mysql_affected_rows</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_affected_rows</function> returns the number
|
||||
of rows affected by the last INSERT, UPDATE or DELETE query
|
||||
associated with <parameter>link_identifier</parameter>. If the
|
||||
|
@ -183,7 +183,7 @@ mysql_close($link);
|
|||
|
||||
<refentry id="function.mysql-change-user">
|
||||
<refnamediv>
|
||||
<refname>mysql_change_user</refname>
|
||||
<refname>mysql_change_user</refname>
|
||||
<refpurpose>
|
||||
Change logged in user of the active connection
|
||||
</refpurpose>
|
||||
|
@ -195,34 +195,34 @@ mysql_close($link);
|
|||
<funcdef>int <function>mysql_change_user</function></funcdef>
|
||||
<paramdef>string <parameter>user</parameter></paramdef>
|
||||
<paramdef>string <parameter>password</parameter></paramdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter>
|
||||
<optional>database</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_change_user</function> changes the logged in user
|
||||
of the current active connection, or the connection given by the
|
||||
of the current active connection, or the connection given by the
|
||||
optional <parameter>link_identifier</parameter> parameter. If a
|
||||
database is specified, this will default or current database after
|
||||
the user has been changed. If the new user and password
|
||||
authorization fails, the current connected user stays active.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- what is returned? bool -> succes/failure i suppose? -->
|
||||
<!-- in PHP 3 int and in PHP 4 bool -->
|
||||
|
||||
<note>
|
||||
<para>
|
||||
This function was introduced in PHP 3.0.13 and requires MySQL
|
||||
3.23.3 or higher.
|
||||
3.23.3 or higher.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
@ -238,9 +238,9 @@ mysql_close($link);
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>mysql_close</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
|
@ -256,12 +256,12 @@ mysql_close($link);
|
|||
<para>
|
||||
Using <function>mysql_close</function> isn't usually necessary,
|
||||
as non-persistent open links are automatically closed at the end
|
||||
of the script's execution. See also
|
||||
<link linkend="language.types.resource.self-destruct">freeing
|
||||
of the script's execution. See also
|
||||
<link linkend="language.types.resource.self-destruct">freeing
|
||||
resources</link>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_close</function> will not close persistent links
|
||||
created by <function>mysql_pconnect</function>.
|
||||
</para>
|
||||
|
@ -279,7 +279,7 @@ mysql_close($link);
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_connect</function>, and
|
||||
<function>mysql_pconnect</function>.
|
||||
</para>
|
||||
|
@ -296,24 +296,24 @@ mysql_close($link);
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_connect</function></funcdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter>
|
||||
<optional>server</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter>
|
||||
<optional>username</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter>
|
||||
<optional>password</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns a MySQL link identifier on success, or &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -321,7 +321,7 @@ mysql_close($link);
|
|||
to a MySQL server. The following defaults are assumed for
|
||||
missing optional parameters: <parameter>server</parameter> =
|
||||
'localhost:3306', <parameter>username</parameter> = name of the
|
||||
user that owns the server process and
|
||||
user that owns the server process and
|
||||
<parameter>password</parameter> = empty password.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -352,7 +352,7 @@ mysql_close($link);
|
|||
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>mysql_close</function>.
|
||||
</para>
|
||||
</para>
|
||||
<example>
|
||||
<title>MySQL connect example</title>
|
||||
<programlisting role="php">
|
||||
|
@ -384,14 +384,14 @@ mysql_close($link);
|
|||
<funcprototype>
|
||||
<funcdef>bool <function>mysql_create_db</function></funcdef>
|
||||
<paramdef>string <parameter>database name</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_create_db</function> attempts to create a new
|
||||
database on the server associated with the specified link
|
||||
identifier.
|
||||
|
@ -415,11 +415,11 @@ mysql_close($link);
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<para>
|
||||
For downwards compatibility <function>mysql_createdb</function>
|
||||
can also be used. This is deprecated, however.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_drop_db</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -442,7 +442,7 @@ mysql_close($link);
|
|||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_data_seek</function> moves the internal row
|
||||
pointer of the MySQL result associated with the specified result
|
||||
identifier to point to the specified row number. The next call
|
||||
|
@ -500,14 +500,14 @@ mysql_close($link);
|
|||
<funcdef>string <function>mysql_db_name</function></funcdef>
|
||||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
<paramdef>int <parameter>row</parameter></paramdef>
|
||||
<paramdef>mixed
|
||||
<paramdef>mixed
|
||||
<parameter>
|
||||
<optional>field</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_db_name</function> takes as its first parameter
|
||||
the result pointer from a call to
|
||||
<function>mysql_list_dbs</function>. The
|
||||
|
@ -524,7 +524,7 @@ mysql_close($link);
|
|||
<title><function>mysql_db_name</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
mysql_connect('dbhost', 'username', 'password');
|
||||
|
@ -559,18 +559,18 @@ while ($i < $cnt) {
|
|||
<funcdef>resource <function>mysql_db_query</function></funcdef>
|
||||
<paramdef>string <parameter>database</parameter></paramdef>
|
||||
<paramdef>string <parameter>query</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns a positive MySQL result resource to the query result,
|
||||
or &false; on error.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_db_query</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
|
||||
|
@ -578,14 +578,14 @@ while ($i < $cnt) {
|
|||
as if <function>mysql_connect</function> was called with no
|
||||
arguments
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also <function>mysql_connect</function> and
|
||||
<function>mysql_query</function>.
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
<simpara>
|
||||
This function has been deprecated since PHP 4.0.6.
|
||||
This function has been deprecated since PHP 4.0.6.
|
||||
Do not use this function. Use <function>mysql_select_db</function>
|
||||
and <function>mysql_query</function> instead.
|
||||
</simpara>
|
||||
|
@ -605,17 +605,17 @@ while ($i < $cnt) {
|
|||
<funcprototype>
|
||||
<funcdef>bool <function>mysql_drop_db</function></funcdef>
|
||||
<paramdef>string <parameter>database_name</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
<function>mysql_drop_db</function> attempts to drop (remove) an
|
||||
entire database from the server associated with the specified
|
||||
link identifier.
|
||||
|
@ -624,7 +624,7 @@ while ($i < $cnt) {
|
|||
For downward compatibility <function>mysql_dropdb</function>
|
||||
can also be used. This is deprecated, however.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_create_db</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -632,7 +632,7 @@ while ($i < $cnt) {
|
|||
|
||||
<refentry id="function.mysql-errno">
|
||||
<refnamediv>
|
||||
<refname>mysql_errno</refname>
|
||||
<refname>mysql_errno</refname>
|
||||
<refpurpose>
|
||||
Returns the numerical value of the error message from previous
|
||||
MySQL operation
|
||||
|
@ -643,7 +643,7 @@ while ($i < $cnt) {
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>mysql_errno</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
|
@ -678,7 +678,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_error</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -697,7 +697,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>mysql_error</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
|
@ -731,7 +731,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_errno</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -739,7 +739,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
|
||||
<refentry id="function.mysql-escape-string">
|
||||
<refnamediv>
|
||||
<refname>mysql_escape_string</refname>
|
||||
<refname>mysql_escape_string</refname>
|
||||
<refpurpose>
|
||||
Escapes a string for use in a mysql_query.
|
||||
</refpurpose>
|
||||
|
@ -767,7 +767,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
|
||||
<refentry id="function.mysql-fetch-array">
|
||||
<refnamediv>
|
||||
<refname>mysql_fetch_array</refname>
|
||||
<refname>mysql_fetch_array</refname>
|
||||
<refpurpose>
|
||||
Fetch a result row as an associative array, a numeric array, or both.
|
||||
</refpurpose>
|
||||
|
@ -785,7 +785,7 @@ echo mysql_errno().": ".mysql_error()."<BR>";
|
|||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or &false;
|
||||
if there are no more rows.</para>
|
||||
<para>
|
||||
|
@ -839,7 +839,7 @@ select tone.field as foo ttwo.field as bar from tone, ttwo
|
|||
<title><function>mysql_fetch_array</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
mysql_connect($host, $user, $password);
|
||||
mysql_select_db("database");
|
||||
$result = mysql_query("select user_id, fullname from table");
|
||||
|
@ -859,7 +859,7 @@ mysql_free_result($result);
|
|||
|
||||
<refentry id="function.mysql-fetch-assoc">
|
||||
<refnamediv>
|
||||
<refname>mysql_fetch_assoc</refname>
|
||||
<refname>mysql_fetch_assoc</refname>
|
||||
<refpurpose>
|
||||
Fetch a result row as an associative array
|
||||
</refpurpose>
|
||||
|
@ -872,7 +872,7 @@ mysql_free_result($result);
|
|||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns an associative array that corresponds to the fetched row,
|
||||
or &false; if there are no more rows.</para>
|
||||
<para>
|
||||
|
@ -908,7 +908,7 @@ mysql_free_result($result);
|
|||
<title><function>mysql_fetch_assoc</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
mysql_connect($host, $user, $password);
|
||||
mysql_select_db($database);
|
||||
$query = "select * from table";
|
||||
|
@ -938,7 +938,7 @@ mysql_free_result($result);
|
|||
<funcprototype>
|
||||
<funcdef>object <function>mysql_fetch_field</function></funcdef>
|
||||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
<paramdef>int
|
||||
<paramdef>int
|
||||
<parameter>
|
||||
<optional>field_offset</optional>
|
||||
</parameter>
|
||||
|
@ -947,7 +947,7 @@ mysql_free_result($result);
|
|||
</funcsynopsis>
|
||||
<para>
|
||||
Returns an object containing field information.
|
||||
</para>
|
||||
</para>
|
||||
<para>
|
||||
<function>mysql_fetch_field</function> can be used in order to
|
||||
obtain information about fields in a certain query result. If
|
||||
|
@ -959,62 +959,62 @@ mysql_free_result($result);
|
|||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
name - column name
|
||||
name - column name
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
table - name of the table the column belongs to
|
||||
table - name of the table the column belongs to
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
max_length - maximum length of the column
|
||||
max_length - maximum length of the column
|
||||
</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_key - 1 if the column is a unique key
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
multiple_key - 1 if the column is a non-unique key
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
numeric - 1 if the column is numeric
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
blob - 1 if the column is a BLOB
|
||||
not_null - 1 if the column cannot be &null;
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
type - the type of the column
|
||||
primary_key - 1 if the column is a primary key
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
unsigned - 1 if the column is unsigned
|
||||
unique_key - 1 if the column is a unique key
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
zerofill - 1 if the column is zero-filled
|
||||
multiple_key - 1 if the column is a non-unique key
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
numeric - 1 if the column is numeric
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
blob - 1 if the column is a BLOB
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
type - the type of the column
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
unsigned - 1 if the column is unsigned
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
zerofill - 1 if the column is zero-filled
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -1023,7 +1023,7 @@ mysql_free_result($result);
|
|||
<title><function>mysql_fetch_field</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
mysql_connect('localhost:3306', $user, $password)
|
||||
or die ("Could not connect");
|
||||
mysql_select_db("database");
|
||||
|
@ -1066,7 +1066,7 @@ mysql_free_result($result);
|
|||
|
||||
<refentry id="function.mysql-fetch-lengths">
|
||||
<refnamediv>
|
||||
<refname>mysql_fetch_lengths</refname>
|
||||
<refname>mysql_fetch_lengths</refname>
|
||||
<refpurpose>
|
||||
Get the length of each output in a result
|
||||
</refpurpose>
|
||||
|
@ -1079,11 +1079,11 @@ mysql_free_result($result);
|
|||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns an array that corresponds to the lengths of each field
|
||||
in the last row fetched by <function>mysql_fetch_row</function>,
|
||||
or &false; on error.
|
||||
</para>
|
||||
</para>
|
||||
<para>
|
||||
<function>mysql_fetch_lengths</function> stores the lengths of
|
||||
each result column in the last row returned by
|
||||
|
@ -1091,8 +1091,8 @@ mysql_free_result($result);
|
|||
<function>mysql_fetch_array</function>, and
|
||||
<function>mysql_fetch_object</function> in an array, starting at
|
||||
offset 0.
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
See also: <function>mysql_fetch_row</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -1116,11 +1116,11 @@ mysql_free_result($result);
|
|||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns an object with properties that correspond to the fetched
|
||||
row, or &false; if there are no more rows.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_fetch_object</function> is similar to
|
||||
<function>mysql_fetch_array</function>, with one difference - an
|
||||
object is returned, instead of an array. Indirectly, that means
|
||||
|
@ -1143,7 +1143,7 @@ mysql_free_result($result);
|
|||
<title><function>mysql_fetch_object</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
mysql_connect("hostname", "user", "password");
|
||||
mysql_select_db($db);
|
||||
$result = mysql_query("select * from table");
|
||||
|
@ -1157,7 +1157,7 @@ mysql_free_result($result);
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
See also: <function>mysql_fetch_array</function> and
|
||||
<function>mysql_fetch_row</function>.
|
||||
</para>
|
||||
|
@ -1177,7 +1177,7 @@ mysql_free_result($result);
|
|||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or &false;
|
||||
if there are no more rows.
|
||||
</para>
|
||||
|
@ -1218,7 +1218,7 @@ mysql_free_result($result);
|
|||
<paramdef>int <parameter>field_offset</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_field_flags</function> returns the field flags of
|
||||
the specified field. The flags are reported as a single word
|
||||
per flag separated by a single space, so that you can split the
|
||||
|
@ -1229,7 +1229,7 @@ mysql_free_result($result);
|
|||
"unique_key", "multiple_key", "blob", "unsigned", "zerofill",
|
||||
"binary", "enum", "auto_increment", "timestamp".
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
For downward compatibility <function>mysql_fieldflags</function>
|
||||
can also be used. This is deprecated, however.
|
||||
</para>
|
||||
|
@ -1238,7 +1238,7 @@ mysql_free_result($result);
|
|||
|
||||
<refentry id="function.mysql-field-name">
|
||||
<refnamediv>
|
||||
<refname>mysql_field_name</refname>
|
||||
<refname>mysql_field_name</refname>
|
||||
<refpurpose>
|
||||
Get the name of the specified field in a result
|
||||
</refpurpose>
|
||||
|
@ -1272,7 +1272,7 @@ mysql_free_result($result);
|
|||
<title><function>mysql_field_name</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
// The users table consists of three fields:
|
||||
// The users table consists of three fields:
|
||||
// user_id
|
||||
// username
|
||||
// password.
|
||||
|
@ -1305,7 +1305,7 @@ password
|
|||
|
||||
<refentry id="function.mysql-field-len">
|
||||
<refnamediv>
|
||||
<refname>mysql_field_len</refname>
|
||||
<refname>mysql_field_len</refname>
|
||||
<refpurpose>
|
||||
Returns the length of the specified field
|
||||
</refpurpose>
|
||||
|
@ -1374,7 +1374,7 @@ password
|
|||
<paramdef>int <parameter>field_offset</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns the name of the table that the specifed field is
|
||||
in.
|
||||
</para>
|
||||
|
@ -1412,7 +1412,7 @@ password
|
|||
<title>MySQL field types</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
|
||||
mysql_connect("localhost:3306");
|
||||
mysql_select_db("wisconsin");
|
||||
|
@ -1422,7 +1422,7 @@ $rows = mysql_num_rows($result);
|
|||
$i = 0;
|
||||
$table = mysql_field_table($result, $i);
|
||||
echo "Your '".$table."' table has ".$fields." fields and ".$rows." records <BR>";
|
||||
echo "The table has the following fields <BR>";
|
||||
echo "The table has the following fields <BR>";
|
||||
while ($i < $fields) {
|
||||
$type = mysql_field_type($result, $i);
|
||||
$name = mysql_field_name($result, $i);
|
||||
|
@ -1438,7 +1438,7 @@ mysql_close();
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
For downward compatibility <function>mysql_fieldtype</function>
|
||||
can also be used. This is deprecated, however.
|
||||
</para>
|
||||
|
@ -1491,7 +1491,7 @@ mysql_close();
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>mysql_insert_id</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
|
@ -1537,7 +1537,7 @@ mysql_close();
|
|||
|
||||
<refentry id="function.mysql-list-dbs">
|
||||
<refnamediv>
|
||||
<refname>mysql_list_dbs</refname>
|
||||
<refname>mysql_list_dbs</refname>
|
||||
<refpurpose>
|
||||
List databases available on a MySQL server
|
||||
</refpurpose>
|
||||
|
@ -1547,7 +1547,7 @@ mysql_close();
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_list_dbs</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
|
@ -1616,7 +1616,7 @@ database3
|
|||
<funcdef>resource <function>mysql_list_fields</function></funcdef>
|
||||
<paramdef>string <parameter>database_name</parameter></paramdef>
|
||||
<paramdef>string <parameter>table_name</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
|
@ -1667,7 +1667,7 @@ field3
|
|||
</para>
|
||||
<!-- TODO: this is equiv. with 'select * from $table where &false;,'
|
||||
which implies you can better use the field-research functions
|
||||
on a real query, that saves you one mysql-query.
|
||||
on a real query, that saves you one mysql-query.
|
||||
-->
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -1683,14 +1683,14 @@ field3
|
|||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_list_tables</function></funcdef>
|
||||
<paramdef>string <parameter>database</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_list_tables</function> takes a database name and
|
||||
returns a result pointer much like the
|
||||
<function>mysql_db_query</function> function. You can use the
|
||||
|
@ -1718,12 +1718,12 @@ field3
|
|||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_num_fields</function> returns the number of
|
||||
fields in a result set.
|
||||
</para>
|
||||
<para>
|
||||
See also:
|
||||
<para>
|
||||
See also:
|
||||
<function>mysql_db_query</function>,
|
||||
<function>mysql_query</function>,
|
||||
<function>mysql_fetch_field</function>,
|
||||
|
@ -1750,8 +1750,8 @@ field3
|
|||
</funcsynopsis>
|
||||
<para>
|
||||
<function>mysql_num_rows</function> returns the number of rows in
|
||||
a result set. This command is only valid for SELECT statements.
|
||||
To retrieve the number of rows affected by a INSERT, UPDATE or
|
||||
a result set. This command is only valid for SELECT statements.
|
||||
To retrieve the number of rows affected by a INSERT, UPDATE or
|
||||
DELETE query, use <function>mysql_affected_rows</function>.
|
||||
<example>
|
||||
<title><function>mysql_num_rows</function> example</title>
|
||||
|
@ -1759,11 +1759,11 @@ field3
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$link = mysql_connect("localhost", "username", "password");
|
||||
$link = mysql_connect("localhost", "username", "password");
|
||||
mysql_select_db("database", $link);
|
||||
|
||||
$result = mysql_query("SELECT * FROM table1", $link);
|
||||
$num_rows = mysql_num_rows($result);
|
||||
$result = mysql_query("SELECT * FROM table1", $link);
|
||||
$num_rows = mysql_num_rows($result);
|
||||
|
||||
echo "$num_rows Rows\n";
|
||||
|
||||
|
@ -1773,10 +1773,10 @@ echo "$num_rows Rows\n";
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also:
|
||||
<function>mysql_affected_rows</function>,
|
||||
<function>mysql_connect</function>,
|
||||
<function>mysql_select_db</function>, and
|
||||
See also:
|
||||
<function>mysql_affected_rows</function>,
|
||||
<function>mysql_connect</function>,
|
||||
<function>mysql_select_db</function>, and
|
||||
<function>mysql_query</function>.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -1788,7 +1788,7 @@ echo "$num_rows Rows\n";
|
|||
|
||||
<refentry id="function.mysql-pconnect">
|
||||
<refnamediv>
|
||||
<refname>mysql_pconnect</refname>
|
||||
<refname>mysql_pconnect</refname>
|
||||
<refpurpose>
|
||||
Open a persistent connection to a MySQL server
|
||||
</refpurpose>
|
||||
|
@ -1798,20 +1798,20 @@ echo "$num_rows Rows\n";
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_pconnect</function></funcdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter>
|
||||
<optional>server</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter><optional>username</optional></parameter>
|
||||
</paramdef>
|
||||
<paramdef>string
|
||||
<paramdef>string
|
||||
<parameter><optional>password</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
Returns a positive MySQL persistent link identifier on success,
|
||||
or &false; on error.
|
||||
</para>
|
||||
|
@ -1836,26 +1836,26 @@ echo "$num_rows Rows\n";
|
|||
3.0.10.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- TODO move the story to features.persistent, and refer to that -->
|
||||
<para>
|
||||
<function>mysql_pconnect</function> acts very much like
|
||||
<function>mysql_connect</function> with two major differences.
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
First, when connecting, the function would first try to find a
|
||||
(persistent) link that's already open with the same host,
|
||||
username and password. If one is found, an identifier for it
|
||||
will be returned instead of opening a new connection.
|
||||
</para>
|
||||
<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>mysql_close</function> will not
|
||||
close links established by <function>mysql_pconnect</function>).
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
This type of link is therefore called 'persistent'.
|
||||
</para>
|
||||
<note>
|
||||
|
@ -1887,12 +1887,12 @@ echo "$num_rows Rows\n";
|
|||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_query</function></funcdef>
|
||||
<paramdef>string <parameter>query</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter><optional>link_identifier</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_query</function> sends a query to the currently
|
||||
active database on the server that's associated with the
|
||||
specified link identifier. If
|
||||
|
@ -2001,12 +2001,12 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
<funcprototype>
|
||||
<funcdef>resource <function>mysql_unbuffered_query</function></funcdef>
|
||||
<paramdef>string <parameter>query</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter><optional>link_identifier</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_unbuffered_query</function> sends a SQL query
|
||||
<parameter>query</parameter> to MySQL, without fetching and
|
||||
buffering the result rows automatically, as
|
||||
|
@ -2047,7 +2047,7 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
<funcdef>mixed <function>mysql_result</function></funcdef>
|
||||
<paramdef>resource <parameter>result</parameter></paramdef>
|
||||
<paramdef>int <parameter>row</parameter></paramdef>
|
||||
<paramdef>mixed
|
||||
<paramdef>mixed
|
||||
<parameter>
|
||||
<optional>field</optional>
|
||||
</parameter>
|
||||
|
@ -2077,7 +2077,7 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
</para>
|
||||
<para>
|
||||
Recommended high-performance alternatives:
|
||||
<function>mysql_fetch_row</function>,
|
||||
<function>mysql_fetch_row</function>,
|
||||
<function>mysql_fetch_array</function>, and
|
||||
<function>mysql_fetch_object</function>.
|
||||
</para>
|
||||
|
@ -2095,17 +2095,17 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
<funcprototype>
|
||||
<funcdef>bool <function>mysql_select_db</function></funcdef>
|
||||
<paramdef>string <parameter>database_name</parameter></paramdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter>
|
||||
<optional>link_identifier</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_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
|
||||
|
@ -2118,7 +2118,7 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
made on the active database.
|
||||
</para>
|
||||
<para> See also:
|
||||
<function>mysql_connect</function>,
|
||||
<function>mysql_connect</function>,
|
||||
<function>mysql_pconnect</function>, and
|
||||
<function>mysql_query</function>.
|
||||
</para>
|
||||
|
@ -2143,7 +2143,7 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
<paramdef>int <parameter>i</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_tablename</function> takes a result pointer
|
||||
returned by the <function>mysql_list_tables</function> function
|
||||
as well as an integer index and returns the name of a table. The
|
||||
|
@ -2153,7 +2153,7 @@ $result = mysql_query("SELECT my_col FROM my_tbl")
|
|||
<title><function>mysql_tablename</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
mysql_connect("host");
|
||||
$result = mysql_list_tables("wisconsin");
|
||||
for ($i = 0; $i < mysql_num_rows($result); $i++) {
|
||||
|
@ -2181,7 +2181,7 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) {
|
|||
<void/>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_get_client_info</function> returns a string that
|
||||
represents the client library version.
|
||||
</para>
|
||||
|
@ -2201,12 +2201,12 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) {
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>mysql_get_host_info</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter><optional>link_identifier</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_get_host_info</function> returns a string
|
||||
describing the type of connection in use for the connection
|
||||
<parameter>link_identifier</parameter>, including the server host
|
||||
|
@ -2229,12 +2229,12 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) {
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>mysql_get_proto_info</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter><optional>link_identifier</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_get_proto_info</function> returns the protocol
|
||||
version used by connection
|
||||
<parameter>link_identifier</parameter>. If
|
||||
|
@ -2257,12 +2257,12 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) {
|
|||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>mysql_get_server_info</function></funcdef>
|
||||
<paramdef>resource
|
||||
<paramdef>resource
|
||||
<parameter><optional>link_identifier</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<para>
|
||||
<function>mysql_get_server_info</function> returns the server
|
||||
version used by connection
|
||||
<parameter>link_identifier</parameter>. If
|
||||
|
|
Loading…
Reference in a new issue