mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
- Rename mysqli_result methods from functions/ to mysqli_result/
- Update the file entities in mysqli_result.xml NOTE: mysqli-field-tell.xml => current-field.xml mysqli-free-result.xml => free.xml mysqli-fetch-lengths.xml => lengths.xml mysqli-num-rows.xml => num-rows.xml mysqli-fetch-row.xml => fetch-row.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@249678 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
bbf16dfad4
commit
bcb3c2a793
15 changed files with 185 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<reference xml:id="class.mysqli-result" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<title>The MySQLi_Result class</title>
|
||||
<titleabbrev>MySQLi_Result</titleabbrev>
|
||||
|
@ -42,23 +42,9 @@
|
|||
|
||||
</partintro>
|
||||
|
||||
<!-- &reference.mysqli.entities.mysqli-result; -->
|
||||
<!-- {{{ FIXME: Remove me -->
|
||||
&reference.mysqli.functions.mysqli-free-result;
|
||||
&reference.mysqli.functions.mysqli-data-seek;
|
||||
&reference.mysqli.functions.mysqli-fetch-array;
|
||||
&reference.mysqli.functions.mysqli-fetch-assoc;
|
||||
&reference.mysqli.functions.mysqli-fetch-field-direct;
|
||||
&reference.mysqli.functions.mysqli-fetch-field;
|
||||
&reference.mysqli.functions.mysqli-fetch-fields;
|
||||
&reference.mysqli.functions.mysqli-fetch-object;
|
||||
&reference.mysqli.functions.mysqli-fetch-row;
|
||||
&reference.mysqli.functions.mysqli-field-seek;
|
||||
&reference.mysqli.functions.mysqli-field-tell;
|
||||
&reference.mysqli.functions.mysqli-fetch-lengths;
|
||||
<!-- }}} -->
|
||||
&reference.mysqli.entities.mysqli-result;
|
||||
|
||||
</reference>
|
||||
</reference>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-field-tell" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_field_tell</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.21 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-data-seek" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_data_seek</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.25 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-array" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_array</refname>
|
169
reference/mysqli/mysqli_result/fetch-assoc.xml
Normal file
169
reference/mysqli/mysqli_result/fetch-assoc.xml
Normal file
|
@ -0,0 +1,169 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-assoc" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_assoc</refname>
|
||||
<refname>mysqli->fetch_assoc()</refname>
|
||||
<refpurpose>Fetch a result row as an associative array</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>Procedural style:</para>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>mysqli_fetch_assoc</methodname>
|
||||
<methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli_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.
|
||||
</para>
|
||||
&database.field-case;
|
||||
&database.fetch-null;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&mysqli.result.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an associative array of strings representing the fetched row in the result
|
||||
set, where each key in the array represents the name of one of the result
|
||||
set's columns or &null; if there are no more rows in resultset.
|
||||
</para>
|
||||
<para>
|
||||
If two or more columns of the result have the same field names, the last
|
||||
column will take precedence. To access the other column(s) of the same
|
||||
name, you either need to access the result with numeric indices by using
|
||||
<function>mysqli_fetch_row</function> or add alias names.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Object oriented style</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (mysqli_connect_errno()) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
|
||||
|
||||
if ($result = $mysqli->query($query)) {
|
||||
|
||||
/* fetch associative array */
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
|
||||
}
|
||||
|
||||
/* free result set */
|
||||
$result->close();
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Procedural style</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (mysqli_connect_errno()) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
/* fetch associative array */
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
|
||||
}
|
||||
|
||||
/* free result set */
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Pueblo (USA)
|
||||
Arvada (USA)
|
||||
Cape Coral (USA)
|
||||
Green Bay (USA)
|
||||
Santa Clara (USA)
|
||||
]]>
|
||||
</screen>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>mysqli_fetch_array</function></member>
|
||||
<member><function>mysqli_fetch_row</function></member>
|
||||
<member><function>mysqli_fetch_object</function></member>
|
||||
<member><function>mysqli_query</function></member>
|
||||
<member><function>mysqli_data_seek</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
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
|
||||
-->
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.17 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-field-direct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_field_direct</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.22 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-field" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_field</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.24 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-fields" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_fields</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.21 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-object" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_object</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.21 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-row" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_row</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-num-fields" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_num_fields</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-field-seek" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_field_seek</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-free-result" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_free_result</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.20 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-fetch-lengths" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_lengths</refname>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.mysqli-num-rows" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysqli_num_rows</refname>
|
Loading…
Reference in a new issue