mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Agregando funciones traducidas de mysqli
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@153809 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a5146131c6
commit
82c913f4d3
31 changed files with 3291 additions and 0 deletions
182
reference/mysqli/mysqli/functions/mysqli-affected-rows.xml
Normal file
182
reference/mysqli/mysqli/functions/mysqli-affected-rows.xml
Normal file
|
@ -0,0 +1,182 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.16 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-affected-rows">
|
||||
<refnamediv>
|
||||
<refname>mysqli_affected_rows</refname>
|
||||
<refname>mysqli->affected_rows</refname>
|
||||
<refpurpose>Obtiene el número de filas afectadas en una operación
|
||||
de MySQL previa</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_affected_rows</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (característica):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<fieldsynopsis><type>mixto</type><varname>affected_rows</varname></fieldsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>mysqli_affected_rows</function> Regresa el número de filas
|
||||
afectadas por la última consulta INSERT, UPDATE, o DELETE asociada
|
||||
con el <parameter>identificador_de_enlace</parameter> dado. Si la última
|
||||
consulta fue invalida, esta función regresará -1.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Para sentencias SELECT <function>mysqli_affected_rows</function> trabaja
|
||||
igual a <function>mysqli_num_rows</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
La función <function>mysqli_affected_rows</function> s&oacoute;lo trabaja
|
||||
con consultas que modifican o afectan una tabla. En caso de que necesite el
|
||||
número de filas de una consulta SELECT, use la función
|
||||
<function>mysqli_num_rows</function> en su lugar.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores Regresados</title>
|
||||
<para>
|
||||
Un entero mayor a cero indica el número de filas afectadas u obtenidas.
|
||||
Cero indica que no se actualizaron registros para una sentencia UPDATE, no hubo
|
||||
coincidencias con la clausula WHERE en la consulta o que no se ha ejecutado
|
||||
aún ninguna consulta. -1 indica que la consulta regreso un error.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Si el número de filas afectadas es mayor que el valor entero máximo,
|
||||
entonces el número de filas afectadas será regresado como una cadena.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_num_rows</function>,
|
||||
<function>mysqli_info</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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();
|
||||
}
|
||||
|
||||
/* Insert rows */
|
||||
$mysqli->query("CREATE TABLE Language SELECT * from CountryLanguage");
|
||||
printf("Affected rows (INSERT): %d\n", $mysqli->affected_rows);
|
||||
|
||||
$mysqli->query("ALTER TABLE Language ADD Status int default 0");
|
||||
|
||||
/* update rows */
|
||||
$mysqli->query("UPDATE Language SET Status=1 WHERE Percentage > 50");
|
||||
printf("Affected rows (UPDATE): %d\n", $mysqli->affected_rows);
|
||||
|
||||
/* delete rows */
|
||||
$mysqli->query("DELETE FROM Language WHERE Percentage < 50");
|
||||
printf("Affected rows (DELETE): %d\n", $mysqli->affected_rows);
|
||||
|
||||
/* select all rows */
|
||||
$result = $mysqli->query("SELECT CountryCode FROM Language");
|
||||
printf("Affected rows (SELECT): %d\n", $mysqli->affected_rows);
|
||||
|
||||
$result->close();
|
||||
|
||||
/* Delete table Language */
|
||||
$mysqli->query("DROP TABLE Language");
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
if (!$link) {
|
||||
printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Insert rows */
|
||||
mysqli_query($link, "CREATE TABLE Language SELECT * from CountryLanguage");
|
||||
printf("Affected rows (INSERT): %d\n", mysqli_affected_rows($link));
|
||||
|
||||
mysqli_query($link, "ALTER TABLE Language ADD Status int default 0");
|
||||
|
||||
/* update rows */
|
||||
mysqli_query($link, "UPDATE Language SET Status=1 WHERE Percentage > 50");
|
||||
printf("Affected rows (UPDATE): %d\n", mysqli_affected_rows($link));
|
||||
|
||||
/* delete rows */
|
||||
mysqli_query($link, "DELETE FROM Language WHERE Percentage < 50");
|
||||
printf("Affected rows (DELETE): %d\n", mysqli_affected_rows($link));
|
||||
|
||||
/* select all rows */
|
||||
$result = mysqli_query($link, "SELECT CountryCode FROM Language");
|
||||
printf("Affected rows (SELECT): %d\n", mysqli_affected_rows($link));
|
||||
|
||||
mysqli_free_result($result);
|
||||
|
||||
/* Delete table Language */
|
||||
mysqli_query($link, "DROP TABLE Language");
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Affected rows (INSERT): 984
|
||||
Affected rows (UPDATE): 168
|
||||
Affected rows (DELETE): 815
|
||||
Affected rows (SELECT): 169
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
143
reference/mysqli/mysqli/functions/mysqli-autocommit.xml
Normal file
143
reference/mysqli/mysqli/functions/mysqli-autocommit.xml
Normal file
|
@ -0,0 +1,143 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.15 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-autocommit">
|
||||
<refnamediv>
|
||||
<refname>mysqli_autocommit</refname>
|
||||
<refname> mysqli->auto_commit</refname>
|
||||
<refpurpose>Activa o desactiva la modificación de auto-entrega de
|
||||
la base de datos</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_autocommit</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
<methodparam><type>bool</type><parameter>modo</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método)</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type>
|
||||
<methodname>auto_commit</methodname>
|
||||
<methodparam><type>bool</type><parameter>modo</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>mysqli_autocommit</function> Es usado para cambiar entre on u off
|
||||
el modo de auto-entrega en las consultas para la conexión a la base
|
||||
de datos representada por el objeto <parameter>identificador_de_enlace</parameter>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqli_autocommit</function> No funciona sobre tablas que no son
|
||||
del tipo transaccional (como MyISAM o ISAM).
|
||||
</para>
|
||||
<para>
|
||||
Para determinar el estado actual de auto-entrega use el comando SQL:
|
||||
'SELECT @@autocommit'.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores que regresa</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_commit</function>,
|
||||
<function>mysqli_rollback</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
||||
|
||||
if (mysqli_connect_errno()) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* turn autocommit on */
|
||||
$mysqli->autocommit(TRUE);
|
||||
|
||||
if ($result = $mysqli->query("SELECT @@autocommit")) {
|
||||
$row = $result->fetch_row();
|
||||
printf("Autocommit is %s\n", $row[0]);
|
||||
$result->free();
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
if (!$link) {
|
||||
printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* turn autocommit on */
|
||||
mysqli_autocommit($link, TRUE);
|
||||
|
||||
if ($result = mysqli_query($link, "SELECT @@autocommit")) {
|
||||
$row = mysqli_fetch_row($result);
|
||||
printf("Autocommit is %s\n", $row[0]);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Autocommit is 1
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
49
reference/mysqli/mysqli/functions/mysqli-bind-param.xml
Normal file
49
reference/mysqli/mysqli/functions/mysqli-bind-param.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-bind-param">
|
||||
<refnamediv>
|
||||
<refname>mysqli_bind_param</refname>
|
||||
<refpurpose>Alias para <function>mysqli_stmt_bind_param</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta función es un alias de <function>mysqli_stmt_bind_param</function>.
|
||||
Para una descripción detallada vea
|
||||
<function>mysqli_stmt_bind_param</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqli_bind_param</function> es obsoleta y será removida.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea tambi&eacuite;n</title>
|
||||
<para>
|
||||
<function>mysqli_stmt_bind_param</function>
|
||||
</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
|
||||
-->
|
49
reference/mysqli/mysqli/functions/mysqli-bind-result.xml
Normal file
49
reference/mysqli/mysqli/functions/mysqli-bind-result.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: baoengb Status; ready -->
|
||||
<refentry id="function.mysqli-bind-result">
|
||||
<refnamediv>
|
||||
<refname>mysqli_bind_result</refname>
|
||||
<refpurpose>Alias para <function>mysqli_stmt_bind_result</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta funció es un alias de <function>mysqli_stmt_bind_result</function>.
|
||||
Para una descripción detallada vea
|
||||
<function>mysqli_stmt_bind_result</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqli_bind_result</function> es obsoleta y será removida.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_stmt_bind_result</function>
|
||||
</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
|
||||
-->
|
188
reference/mysqli/mysqli/functions/mysqli-change-user.xml
Normal file
188
reference/mysqli/mysqli/functions/mysqli-change-user.xml
Normal file
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-change-user">
|
||||
<refnamediv>
|
||||
<refname>mysqli_change_user</refname>
|
||||
<refname>mysqli->change_user</refname>
|
||||
<refpurpose>Cambia el usuario de la conexión a la base de datos especificada</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_change_user</methodname>
|
||||
<methodparam><type>object</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
<methodparam><type>cadena</type><parameter>usuario</parameter></methodparam>
|
||||
<methodparam><type>cadena</type><parameter>contraseña</parameter></methodparam>
|
||||
<methodparam><type>cadena</type><parameter>base_de_datos</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type>
|
||||
<methodname>change_user</methodname>
|
||||
<methodparam><type>cadena</type><parameter>usuario</parameter></methodparam>
|
||||
<methodparam><type>cadena</type><parameter>contraseńa</parameter></methodparam>
|
||||
<methodparam><type>cadena</type><parameter>base_de_datos</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>mysqli_change_user</function> Es usada para cambiar el usuario para
|
||||
la conexión de base de datos indicada por el parámetro
|
||||
<parameter>identificador_de_enlace</parameter> y para fijar la actual base de datos a la específicada
|
||||
por el parámetro <parameter>base_de_datos</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
Si se desea, se puede pasar el valor &null; en lugar del parámetro
|
||||
<parameter>base_de_datos</parameter> resultando en solo cambiar el usaurio y no
|
||||
seleccionar la base de datos. Para seleccionar una base de datos en este caso
|
||||
use la función <function>mysqli_select_db</function>.
|
||||
</para>
|
||||
<para>
|
||||
Para poder cambiar de usuario de forma exitosa se debe proveer de un
|
||||
<parameter>usuario</parameter> y <parameter>contraseña</parameter>
|
||||
validos, y tales parámetros debe contar con los suficientes permisos
|
||||
para acceder a la base de datos deseada. Si por cualquier razón la
|
||||
autorización falla, el actual usuario autenticado permanecerá activo.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
El uso de este comando siempre producirá que la conexión actual
|
||||
a la base de datos se comporte como si fuera una nueva conexión,
|
||||
sin importar si la operación fue completada exitosamente. Este reinicio
|
||||
implica el hacer la restauración no actualizada "rollback" de cualquier
|
||||
transacción activa, cerrar todas las tablas temporales y des-asegurar
|
||||
todas las tablas aseguradas.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también:</title>
|
||||
<para>
|
||||
<function>mysqli_connect</function>
|
||||
<function>mysqli_select_db</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* connect database test */
|
||||
$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
|
||||
|
||||
/* check connection */
|
||||
if (mysqli_connect_errno()) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Set Variable a */
|
||||
$mysqli->query("SET @a:=1");
|
||||
|
||||
/* reset all and select a new database */
|
||||
$mysqli->change_user("my_user", "my_password", "world");
|
||||
|
||||
if ($result = $mysqli->query("SELECT DATABASE()")) {
|
||||
$row = $result->fetch_row();
|
||||
printf("Default database: %s\n", $row[0]);
|
||||
$result->close();
|
||||
}
|
||||
|
||||
if ($result = $mysqli->query("SELECT @a")) {
|
||||
$row = $result->fetch_row();
|
||||
if ($row[0] === NULL) {
|
||||
printf("Value of variable a is NULL\n");
|
||||
}
|
||||
$result->close();
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* connect database test */
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "test");
|
||||
|
||||
/* check connection */
|
||||
if (!$link) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Set Variable a */
|
||||
mysqli_query($link, "SET @a:=1");
|
||||
|
||||
/* reset all and select a new database */
|
||||
mysqli_change_user($link, "my_user", "my_password", "world");
|
||||
|
||||
if ($result = mysqli_query($link, "SELECT DATABASE()")) {
|
||||
$row = mysqli_fetch_row($result);
|
||||
printf("Default database: %s\n", $row[0]);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
if ($result = mysqli_query($link, "SELECT @a")) {
|
||||
$row = mysqli_fetch_row($result);
|
||||
if ($row[0] === NULL) {
|
||||
printf("Value of variable a is NULL\n");
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Default database: world
|
||||
Value of variable a is NULL
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
124
reference/mysqli/mysqli/functions/mysqli-character-set-name.xml
Normal file
124
reference/mysqli/mysqli/functions/mysqli-character-set-name.xml
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-character-set-name">
|
||||
<refnamediv>
|
||||
<refname>mysqli_character_set_name</refname>
|
||||
<refname>mysqli->character_set_name</refname>
|
||||
<refpurpose>Regresa el conjunto de caracteres determinados por default para
|
||||
la conexión de base de datos</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedumientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>cadena</type><methodname>mysqli_character_set_name</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>cadena</type>
|
||||
<methodname>character_set_name</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Regresa el conjuntos de caracteres actual, determinado para la conexión
|
||||
de base de datos específicada por el parámetro
|
||||
<parameter>identificador_de_enlace</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>El conjunto de caracteres por defecto, determinados para la
|
||||
conexión actual</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_client_encoding</function>.
|
||||
<function>mysqli_real_escape_string</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (mysqli_connect_errno()) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Print current character set */
|
||||
$charset = $mysqli->character_set_name();
|
||||
printf ("Current character set is %s\n", $charset);
|
||||
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (!$link) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Print current character set */
|
||||
$charset = mysqli_character_set_name($link);
|
||||
printf ("Current character set is %s\n",$charset);
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Current character set is latin1_swedish_ci
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
45
reference/mysqli/mysqli/functions/mysqli-client-encoding.xml
Normal file
45
reference/mysqli/mysqli/functions/mysqli-client-encoding.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-client-encoding">
|
||||
<refnamediv>
|
||||
<refname>mysqli_client_encoding</refname>
|
||||
<refpurpose>Alias de <function>mysqli_character_set_name</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta función es un alias de <function>mysqli_character_set_name</function>.
|
||||
Para una descripción detallada vea
|
||||
<function>mysqli_character_set_name</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_client_encoding</function>.
|
||||
<function>mysqli_real_escape_string</function>.
|
||||
</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
|
||||
-->
|
67
reference/mysqli/mysqli/functions/mysqli-close.xml
Normal file
67
reference/mysqli/mysqli/functions/mysqli-close.xml
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-close">
|
||||
<refnamediv>
|
||||
<refname>mysqli_close</refname>
|
||||
<refname>mysqli->close</refname>
|
||||
<refpurpose>Cierra la conexión de base de datos previamente abierta</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_close</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type>
|
||||
<methodname>close</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_close</function> cierra una conexión
|
||||
de base de datos previamente abierta, específicada por el parámetro
|
||||
<parameter>identificador_de_enlace<parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_connect</function>,
|
||||
<function>mysqli_init</function>,
|
||||
<function>mysqli_real_connect</function>.
|
||||
</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
|
||||
-->
|
136
reference/mysqli/mysqli/functions/mysqli-commit.xml
Normal file
136
reference/mysqli/mysqli/functions/mysqli-commit.xml
Normal file
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-commit">
|
||||
<refnamediv>
|
||||
<refname>mysqli_commit</refname>
|
||||
<refname>mysqli->commit</refname>
|
||||
<refpurpose>Completa la transacción actual</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_commit</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método)</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type>
|
||||
<methodname>commit</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Entrega la transacción actual para la conexión de base de datos
|
||||
específicada por el parametro
|
||||
<parameter>link</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_autocommit</function>,
|
||||
<function>mysqli_rollback</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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();
|
||||
}
|
||||
|
||||
$mysqli->query("CREATE TABLE Language LIKE CountryLanguage Type=InnoDB");
|
||||
|
||||
/* set autocommit to off */
|
||||
$mysqli->autocommit(FALSE);
|
||||
|
||||
/* Insert some values */
|
||||
$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F', 11.2)");
|
||||
$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");
|
||||
|
||||
/* commit transaction */
|
||||
$mysqli->commit();
|
||||
|
||||
/* drop table */
|
||||
$mysqli->query("DROP TABLE Language");
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "test");
|
||||
|
||||
/* check connection */
|
||||
if (!$link) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
/* set autocommit to off */
|
||||
mysqli_autocommit($link, FALSE);
|
||||
|
||||
mysqli_query($link, "CREATE TABLE Language LIKE CountryLanguage Type=InnoDB");
|
||||
|
||||
/* Insert some values */
|
||||
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F', 11.2)");
|
||||
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");
|
||||
|
||||
/* commit transaction */
|
||||
mysqli_commit($link);
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
92
reference/mysqli/mysqli/functions/mysqli-connect-errno.xml
Normal file
92
reference/mysqli/mysqli/functions/mysqli-connect-errno.xml
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-connect-errno">
|
||||
<refnamediv>
|
||||
<refname>mysqli_connect_errno</refname>
|
||||
<refpurpose>Regresa el código de error de la última llamada a la conexión</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>mysqli_connect_errno</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_connect_errno</function> regresará
|
||||
el últumo código de error generado por
|
||||
<function>mysqli_connect</function>.
|
||||
Si no han ocurrido errores, esta función regresará cero.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Los números de error del cliente, están listados en el archivo
|
||||
de MySQL <filename>errmsg.h</filename>.
|
||||
Los números de error del servidor, están listados en el archivo
|
||||
de MySQL <filename>mysqld_error.h</filename>.
|
||||
En la distribución de las fuentes de MySQL, tu puedes encontrar una
|
||||
lista completa de los mensajes de error y de los números de error
|
||||
en el documento <filename>Docs/mysqld_error.txt</filename>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Un código de error para la última llamada a <function>mysqli_connect</function>,
|
||||
si ésta falla.
|
||||
Si no hay error entonces se regresa Cero.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_connect</function>,
|
||||
<function>mysqli_connect_error</function>,
|
||||
<function>mysqli_errno</function>,
|
||||
<function>mysqli_error</function>,
|
||||
<function>mysqli_sqlstate</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplo</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>mysqli_connect_errno</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$link = @mysqli_connect("localhost", "nonexisting_user", "");
|
||||
|
||||
if (!$link) {
|
||||
printf("Can't connect to localhost. Errorcode: %d\n", mysqli_connect_errno());
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
84
reference/mysqli/mysqli/functions/mysqli-connect-error.xml
Normal file
84
reference/mysqli/mysqli/functions/mysqli-connect-error.xml
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-connect-error">
|
||||
<refnamediv>
|
||||
<refname>mysqli_connect_error</refname>
|
||||
<refpurpose>Regresa una descripción del último error de la
|
||||
conexión</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>cadena</type><methodname>mysqli_connect_error</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_connect_error</function> es identica a
|
||||
la función <function>mysqli_connect_errno</function>, excepto en que
|
||||
en vez de regresar el número del código de error, la función
|
||||
<function>mysqli_connect_error</function> regresará el mensaje de error
|
||||
correspondiente a la última llamada a la función <function>mysqli_connect</function>.
|
||||
Si no ha ocurrido error, está función regresará una cadena
|
||||
vacía.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Una cadena que describe el error o una cadena vacía si no ha ocurrido
|
||||
error.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_connect</function>,
|
||||
<function>mysqli_connect_errno</function>,
|
||||
<function>mysqli_errno</function>,
|
||||
<function>mysqli_error</function>,
|
||||
<function>mysqli_sqlstate</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplo</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>mysqli_connect_error</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$link = @mysqli_connect("localhost", "nonexisting_user", "");
|
||||
|
||||
if (!$link) {
|
||||
printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error());
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
158
reference/mysqli/mysqli/functions/mysqli-connect.xml
Normal file
158
reference/mysqli/mysqli/functions/mysqli-connect.xml
Normal file
|
@ -0,0 +1,158 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.15 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-connect">
|
||||
<refnamediv>
|
||||
<refname>mysqli_connect</refname>
|
||||
<refname>mysqli()</refname>
|
||||
<refpurpose>Abre una nueva conexión al servidor MySQL</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos</para>
|
||||
<methodsynopsis>
|
||||
<type>objeto</type><methodname>mysqli_connect</methodname>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>equipo_anfitrión</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>usuario</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>contraseña</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>base_de_datos</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>int</type><parameter>puerto</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>socket</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (constructor):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<constructorsynopsis>
|
||||
<methodname>__construct</methodname>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>equipo_anfitrión</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>usuario</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>contraseña</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>base_de_datos</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>int</type><parameter>puerto</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>cadena</type><parameter>socket</parameter></methodparam>
|
||||
</constructorsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_connect</function> intenta abrir una conexión
|
||||
al servidor MySQL que se está ejecutando en <parameter>equipo_afitrión</parameter>
|
||||
el cual puede ser el nombre de un equipo o una dirección IP. Pasando el
|
||||
valor &null; o la cadena "localhost" a este parámetro, se asume que
|
||||
está en el mismo equipo. Cuando sea posible se usar&Acute; "pipes" en vez
|
||||
del protocolo TCP/IP. En caso exitoso, la función <function>mysqli_connect</function>
|
||||
regresará un objeto representando la conexión a la base de datos,
|
||||
o &false; en caso contrario.
|
||||
</para>
|
||||
<para>
|
||||
En los parámetros <parameter>usuario</parameter> y <parameter>contraseña</parameter>
|
||||
se específica el nombre de usuario y contraseña con los cuales
|
||||
se debe conectar al servidor MySQL. Si no se da contraseña el valor
|
||||
&null; es tomado, el servidor MySQL intentará verificar al usuario
|
||||
contra los registros de usuarios que esten sin contraseña. Esto permite
|
||||
que un usuario pueda ser usado con diferentes permisos (dependiendo si se
|
||||
provee contraseña o no).
|
||||
</para>
|
||||
<para>
|
||||
Si se específica el parámetro <parameter>base_de_datos</parameter>
|
||||
especificará la base de datos a usar por defecto cuando se ejecuten
|
||||
consultas.
|
||||
</para>
|
||||
<para>
|
||||
Los parámetros <parameter>puerto</parameter> y <parameter>socket</parameter>
|
||||
son usados junto con el parámetro <parameter>equipo_anfitrión</parameter>
|
||||
para controla a futuro como conectar al servidor de base de datos.
|
||||
El parámetro <parameter>puerto</parameter> específica el número
|
||||
de puerto al que se intenta conectar en el servidor MySQL, mientras que el
|
||||
parámetro <parameter>socket</parameter> específica el socket o
|
||||
la pipa nombrada "pipe" que debe ser usada.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Especificar el parámetro <parameter>socket</parameter> no determina
|
||||
explícitamente el tipo de conexión a ser usado cuando se conecta
|
||||
al servidor MySQL. El parámetro <parameter>equipo_anfitrión</parameter>
|
||||
determina como se hace la conexión a la base de datos MySQL.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa un objeto el cuál representa la conexión al servidor
|
||||
MySQL o &false; en caso contrario.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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();
|
||||
}
|
||||
|
||||
printf("Host information: %s\n", $mysqli->host_info);
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (!$link) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
printf("Host information: %s\n", mysqli_get_host_info($link));
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Host information: Localhost via UNIX socket
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
159
reference/mysqli/mysqli/functions/mysqli-data-seek.xml
Normal file
159
reference/mysqli/mysqli/functions/mysqli-data-seek.xml
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.14 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-data-seek">
|
||||
<refnamediv>
|
||||
<refname>mysqli_data_seek</refname>
|
||||
<refname>result->data_seek</refname>
|
||||
<refpurpose>Ajusta el apuntador arbitrariamente a una fila en el resultado</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_data_seek</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>posición</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type>
|
||||
<methodname>data_seek</methodname>
|
||||
<methodparam><type>int</type><parameter>posición</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_data_seek</function> busca arbitrariamente
|
||||
apuntar al valor específicado por <parameter>posición</parameter>
|
||||
en el conjunto resultante representado por <parameter>result</parameter>.
|
||||
Los valores del parámetro <parameter>posición</parameter>
|
||||
deben estar entre cero y el total de filas menus uno (0 .. <function>mysqli_num_rows</function> - 1).
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Está función solo puede ser usada con resultados sin almacenamiento
|
||||
intermedio logrados por el uso de las funciones
|
||||
<function>mysqli_store_result</function> o <function>mysqli_query</function>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_store_result</function>,
|
||||
<function>mysqli_fetch_row</function>,
|
||||
<function>mysqli_num_rows</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a onjetos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$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 Name";
|
||||
if ($result = $mysqli->query( $query)) {
|
||||
|
||||
/* seek to row no. 400 */
|
||||
$result->data_seek(399);
|
||||
|
||||
/* fetch row */
|
||||
$row = $result->fetch_row();
|
||||
|
||||
printf ("City: %s Countrycode: %s\n", $row[0], $row[1]);
|
||||
|
||||
/* free result set*/
|
||||
$result->close();
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
||||
|
||||
/* check connection */
|
||||
if (!$link) {
|
||||
printf("Connect failed: %s\n", mysqli_connect_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "SELECT Name, CountryCode FROM City ORDER BY Name";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
/* seek to row no. 400 */
|
||||
mysqli_data_seek($result, 399);
|
||||
|
||||
/* fetch row */
|
||||
$row = mysqli_fetch_row($result);
|
||||
|
||||
printf ("City: %s Countrycode: %s\n", $row[0], $row[1]);
|
||||
|
||||
/* free result set*/
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
City: Benin City Countrycode: NGA
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
78
reference/mysqli/mysqli/functions/mysqli-debug.xml
Normal file
78
reference/mysqli/mysqli/functions/mysqli-debug.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-debug">
|
||||
<refnamediv>
|
||||
<refname>mysqli_debug</refname>
|
||||
<refpurpose>Realiza operaciones de rastreo de errores</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>mysqli_debug</methodname>
|
||||
<methodparam><type>cadena</type><parameter>acción</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_debug</function> es usada para realizar
|
||||
operaciones de rastreo y eliminación de errores utilizando la libreria
|
||||
"Fred Fish". El parámetro <parameter>acción</parameter>
|
||||
es una cadena que representa las operaciones de rastreo de errores a realizar.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Para usar la funció <function>mysqli_debug</function> se debe compilar
|
||||
el cliente de MySQL con soporte para rastreo de errores "debugging".
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para><function>mysqli_debug</function> no regresa ningún valor.</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_dump_debug_info</function>,
|
||||
<function>mysqli_report</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplo</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>Generar un archivo de rastreo</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* Create a trace file in '/tmp/client.trace' on the local (client) machine: */
|
||||
mysqli_debug("d:t:0,/tmp/client.trace");
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-disable-reads-from-master">
|
||||
<refnamediv>
|
||||
<refname>mysqli_disable_reads_from_master</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>mysqli_disable_reads_from_master</methodname>
|
||||
<methodparam><type>int</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.experimental.func;
|
||||
|
||||
</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
|
||||
-->
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-disable-rpl-parse">
|
||||
<refnamediv>
|
||||
<refname>mysqli_disable_rpl_parse</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>mysqli_disable_rpl_parse</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.experimental.func;
|
||||
|
||||
</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
|
||||
-->
|
56
reference/mysqli/mysqli/functions/mysqli-dump-debug-info.xml
Normal file
56
reference/mysqli/mysqli/functions/mysqli-dump-debug-info.xml
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-dump-debug-info">
|
||||
<refnamediv>
|
||||
<refname>mysqli_dump_debug_info</refname>
|
||||
<refname>mysqli->dump_debug_info</refname>
|
||||
<refpurpose>Vacía información de rastreo de errores en el log</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>mysqli_dump_debug_info</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esta función está diseñada para ser ejecutada por un
|
||||
usaurio con privilegios de SUPER usuario y es usada para vaciar la información
|
||||
de rastreo de errores en el log del servidor MySQL relacionado a la conexión
|
||||
específicada por el parámetro <parameter>identificador_de_enlace</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_debug</function>.
|
||||
</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
|
||||
-->
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-embedded-connect">
|
||||
<refnamediv>
|
||||
<refname>mysqli_embedded_connect</refname>
|
||||
<refpurpose>Abre una conexió a un servidor MySQL embebido.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>mysqli_embedded_connect</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.experimental.func;
|
||||
|
||||
</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
|
||||
-->
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-enable-reads-from-master">
|
||||
<refnamediv>
|
||||
<refname>mysqli_enable_reads_from_master</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>mysqli_enable_reads_from_master</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.experimental.func;
|
||||
|
||||
</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
|
||||
-->
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-enable-rpl-parse">
|
||||
<refnamediv>
|
||||
<refname>mysqli_enable_rpl_parse</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>mysqli_enable_rpl_parse</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.experimental.func;
|
||||
|
||||
</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
|
||||
-->
|
136
reference/mysqli/mysqli/functions/mysqli-errno.xml
Normal file
136
reference/mysqli/mysqli/functions/mysqli-errno.xml
Normal file
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-errno">
|
||||
<refnamediv>
|
||||
<refname>mysqli_errno</refname>
|
||||
<refname>mysql->errno</refname>
|
||||
<refpurpose>Regresa el código de error para la función más
|
||||
recientemente llamada</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>mysqli_errno</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (propiedad):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_errno</function> regresará el último
|
||||
código de error para la función de MySQLi más recientemente
|
||||
llamada, que pueda ser exitosa o fallar con respecto al identificador de enlace a
|
||||
la base de datos definido por el parámetro <parameter>identificador_de_enlace</parameter>.
|
||||
Si no han ocurrido errores, está función regresará cero.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Los números de error del cliente, están listados en el archivo
|
||||
de MySQL <filename>errmsg.h</filename>.
|
||||
Los números de error del servidor, están listados en el archivo
|
||||
de MySQL <filename>mysqld_error.h</filename>.
|
||||
En la distribución de las fuentes de MySQL, tu puedes encontrar una
|
||||
lista completa de los mensajes de error y de los números de error
|
||||
en el documento <filename>Docs/mysqld_error.txt</filename>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Un valor de código de error para la última llamada si falló.
|
||||
Cero significa que no han ocurrido errores.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_connect_errno</function>,
|
||||
<function>mysqli_connect_error</function>,
|
||||
<function>mysqli_error</function>,
|
||||
<function>mysqli_sqlstate</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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();
|
||||
}
|
||||
|
||||
if (!$mysqli->query("SET a=1")) {
|
||||
printf("Errorcode: %d\n", $mysqli->errno);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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();
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, "SET a=1")) {
|
||||
printf("Errorcode: %d\n", mysqli_errno($link));
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Errorcode: 1193
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
124
reference/mysqli/mysqli/functions/mysqli-error.xml
Normal file
124
reference/mysqli/mysqli/functions/mysqli-error.xml
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-error">
|
||||
<refnamediv>
|
||||
<refname>mysqli_error</refname>
|
||||
<refpurpose>Regresa una cadena con la descripció del último error</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>cadena</type><methodname>mysqli_error</methodname>
|
||||
<methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (propiedad)</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>mysqli</classname></ooclass>
|
||||
<fieldsynopsis><type>cadena</type><varname>error</varname></fieldsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La funció <function>mysqli_error</function> es identica a la correspondiente
|
||||
<function>mysqli_errno</function> en todos los sentidos, excepto en que en
|
||||
lugar de regresar un valor numérico, la función <function>mysqli_error</function>
|
||||
regresará un mensaje de error, representando el último error
|
||||
ocurrido para la conexió de base de datos <parameter>identificador_de_enlace</parameter>.
|
||||
Si no han ocurrido errores, está función regresará una cadena vacía.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Una cadena que describe el error. Una cadena vacía si no han ocurrido
|
||||
errores.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_connect_errno</function>,
|
||||
<function>mysqli_connect_error</function>,
|
||||
<function>mysqli_errno</function>,
|
||||
<function>mysqli_sqlstate</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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();
|
||||
}
|
||||
|
||||
if (!$mysqli->query("SET a=1")) {
|
||||
printf("Errormessage: %s\n", $mysqli->error);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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();
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, "SET a=1")) {
|
||||
printf("Errormessage: %s\n", mysqli_error($link));
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Errormessage: Unknown system variable 'a'
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
36
reference/mysqli/mysqli/functions/mysqli-escape-string.xml
Normal file
36
reference/mysqli/mysqli/functions/mysqli-escape-string.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-escape-string">
|
||||
<refnamediv>
|
||||
<refname>mysqli-escape-string</refname>
|
||||
<refpurpose>Alias de <function>mysqli_real_escape_string</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta función es un alias de <function>mysqli_real_escape_string</function>.
|
||||
</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
|
||||
-->
|
49
reference/mysqli/mysqli/functions/mysqli-execute.xml
Normal file
49
reference/mysqli/mysqli/functions/mysqli-execute.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.13 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-execute">
|
||||
<refnamediv>
|
||||
<refname>mysqli_execute</refname>
|
||||
<refpurpose>Alias de <function>mysqli_stmt_execute</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta función es un alias de <function>mysqli_stmt_execute</function>.
|
||||
Para una descipció más detallada vea la descripción de
|
||||
<function>mysqli_stmt_execute</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqli_execute</function> es obsoleta y será removida.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_stmt_execute</function>
|
||||
</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
|
||||
-->
|
184
reference/mysqli/mysqli/functions/mysqli-fetch-array.xml
Normal file
184
reference/mysqli/mysqli/functions/mysqli-fetch-array.xml
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.14 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-array">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_array</refname>
|
||||
<refname>result->fetch_array</refname>
|
||||
<refpurpose>Obtiene una fila como una matriz asociativa, una matriz numérica o ambos.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_fetch_array</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>int</type><parameter>tipo_de_resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type>
|
||||
<methodname>fetch_array</methodname>
|
||||
<methodparam choice='opt'><type>int</type><parameter>tipo_de_resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Regresa una matrix que corresponde a las filas obtenidas o &null; si no hay
|
||||
más filas para el resultado, representado por el parámetro
|
||||
<parameter>resultado</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
<function>mysqli_fetch_array</function> es una versión mejorada de la función
|
||||
<function>mysqli_fetch_row</function>. Ademá de almacenar los datos en
|
||||
índices numéricos de la matriz resultante, la función
|
||||
<function>mysql_fetch_array</function> también puede almacenar los datos en
|
||||
índices asociativos, usando los nombre de los campos de el resultado como llaves.
|
||||
</para>
|
||||
&database.field-case;
|
||||
<para>
|
||||
Si dos o más columnas de el resultado tienen el mismo nombre, la última
|
||||
columna tomara precedencia y sobre escribirá lo primero. Para acceder a
|
||||
varias columnas con el mismo nombre, la forma de índice numérica
|
||||
debe ser usada.
|
||||
</para>
|
||||
<para>
|
||||
El parámetro opcional <parameter>tipo_de_resultado</parameter> es una
|
||||
constante que indica qué tipo de matriz debe ser producido para la fila
|
||||
de datos actual. Los posibles valires para este parámetro son las constantes
|
||||
MYSQLI_ASSOC, MYSQLI_NUM, o MYSQLI_BOTH. Por defecto la función
|
||||
<function>mysqli_fetch_array</function> asumirá el valor de MYSQLI_BOTH.
|
||||
</para>
|
||||
<para>
|
||||
Al usar la constante MYSQLI_ASSOC, esta función se comportará
|
||||
identica a la función <function>mysqli_fetch_assoc</function>, mientras
|
||||
que con MYSQLI_NUM se comportará identica a la función
|
||||
<function>mysql_fetch_row</function>. La opción final MYSQLI_BOTH
|
||||
creará una matriz con los atributos de ambos.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa una matriz que corresponde a las filas obtenidas o &null; si no hay
|
||||
más filas en el resultado.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_fetch_assoc</function>,
|
||||
<function>mysqli_fetch_row</function>,
|
||||
<function>mysqli_fetch_object</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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 LIMIT 3";
|
||||
$result = $mysqli->query($query);
|
||||
|
||||
/* numeric array */
|
||||
$row = $result->fetch_array(MYSQLI_NUM);
|
||||
printf ("%s (%s)\n", $row[0], $row[1]);
|
||||
|
||||
/* associative array */
|
||||
$row = $result->fetch_array(MYSQLI_ASSOC);
|
||||
printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
|
||||
|
||||
/* associative and numeric array */
|
||||
$row = $result->fetch_array(MYSQLI_BOTH);
|
||||
printf ("%s (%s)\n", $row[0], $row["CountryCode"]);
|
||||
|
||||
/* free result set */
|
||||
$result->close();
|
||||
|
||||
/* close connection */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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 LIMIT 3";
|
||||
$result = mysqli_query($link, $query);
|
||||
|
||||
/* numeric array */
|
||||
$row = mysqli_fetch_array($result, MYSQLI_NUM);
|
||||
printf ("%s (%s)\n", $row[0], $row[1]);
|
||||
|
||||
/* associative array */
|
||||
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
|
||||
printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
|
||||
|
||||
/* associative and numeric array */
|
||||
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
|
||||
printf ("%s (%s)\n", $row[0], $row["CountryCode"]);
|
||||
|
||||
/* free result set */
|
||||
mysqli_free_result($result);
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producián la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Kabul (AFG)
|
||||
Qandahar (AFG)
|
||||
Herat (AFG)
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
159
reference/mysqli/mysqli/functions/mysqli-fetch-assoc.xml
Normal file
159
reference/mysqli/mysqli/functions/mysqli-fetch-assoc.xml
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-assoc">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_assoc</refname>
|
||||
<refname>mysqli->fetch_assoc</refname>
|
||||
<refpurpose>Obtiene una fila del resultado como una matriz asociativa</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>matriz</type><methodname>mysqli_fetch_assoc</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>matriz</type>
|
||||
<methodname>fetch_assoc</methodname>
|
||||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Regresa una matriz asociativa que corresponde a las filas obtenidas o &null;
|
||||
si no hay mas filas.
|
||||
</para>
|
||||
<para>
|
||||
La función <function>mysqli_fetch_assoc</function> es usada para regresar
|
||||
una representación asociativa de la siguiente fila en el resultado,
|
||||
representado por el parámetro <parameter>resultado</parameter>, donde
|
||||
cada llave en la matriz representa el nombre de las columnas en el resultado.
|
||||
</para>
|
||||
<para>
|
||||
Si dos o más columnas de el resultado tienen el mismo nombre, la última
|
||||
columna tomara precedencia y sobre escribirá lo primero. Para acceder a
|
||||
varias columnas con el mismo nombre, la forma de índice numérica
|
||||
debe ser usada.
|
||||
</para>
|
||||
&database.field-case;
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa una matriz que corresponde a las filas obtenidas o &null; si no hay
|
||||
más filas en el resultado.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_fetch_array</function>,
|
||||
<function>mysqli_fetch_row</function>,
|
||||
<function>mysqli_fetch_object</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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>Estilo por procedimientos</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>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Pueblo (USA)
|
||||
Arvada (USA)
|
||||
Cape Coral (USA)
|
||||
Green Bay (USA)
|
||||
Santa Clara (USA)
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
209
reference/mysqli/mysqli/functions/mysqli-fetch-field-direct.xml
Normal file
209
reference/mysqli/mysqli/functions/mysqli-fetch-field-direct.xml
Normal file
|
@ -0,0 +1,209 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-field-direct">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_field_direct</refname>
|
||||
<refname>result->fetch_field_direct</refname>
|
||||
<refpurpose>
|
||||
Obtiene los metadatos de un campo
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_fetch_field_direct</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>indice_de_campo</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type>
|
||||
<methodname>fetch_field_direct</methodname>
|
||||
<methodparam><type>int</type><parameter>indice_de_campo</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_fetch_field_direct</function> regresa un
|
||||
objeto el cuál contiene información de la definición del
|
||||
campo del resultado específicado. El valor de indice_de_campo debe estar
|
||||
en el rango de <literal>0</literal> a <literal>número de campos -1</literal>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa un objeto el cual contiene información de la definición del
|
||||
campo o &false; si no hay información para el <literal>indice_de_campo</literal>
|
||||
específicado.
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title>Atributos del objeto</title>
|
||||
<tgroup cols='2'>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Atributo</entry>
|
||||
<entry>Descripción</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>Nombre de la columna</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>orgname</entry>
|
||||
<entry>Nombre original de la columna si se dió un alias</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>table</entry>
|
||||
<entry>Nombre de la tabla a la que pertenece el campo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>orgtable</entry>
|
||||
<entry>Nombre original de la tabla si se dió un alias</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>def</entry>
|
||||
<entry>El valor por defecto para este campo, representado como una cadena</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>max_length</entry>
|
||||
<entry>La amplitud máxima de campo de el campo para el resultado</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>flags</entry>
|
||||
<entry>Un entero que representa los bit bandera para el campo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>type</entry>
|
||||
<entry>Tipo de dato utilizado para este campo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>decimals</entry>
|
||||
<entry>Número de decimales usadas (para campos entero)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_num_fields</function>
|
||||
<function>mysqli_fetch_field</function>
|
||||
<function>mysqli_fetch_fields</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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, SurfaceArea from Country ORDER BY Name LIMIT 5";
|
||||
|
||||
if ($result = $mysqli->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 */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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, SurfaceArea from Country ORDER BY Name LIMIT 5";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
/* Get field information for column 'SurfaceArea' */
|
||||
$finfo = mysqli_fetch_field_direct($result, 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);
|
||||
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Name: SurfaceArea
|
||||
Table: Country
|
||||
max. Len: 10
|
||||
Flags: 32769
|
||||
Type: 4
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
214
reference/mysqli/mysqli/functions/mysqli-fetch-field.xml
Normal file
214
reference/mysqli/mysqli/functions/mysqli-fetch-field.xml
Normal file
|
@ -0,0 +1,214 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-field">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_field</refname>
|
||||
<refname>result->fetch_field</refname>
|
||||
<refpurpose>Regresa metadatos de el campo en el resultado</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_fetch_field</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type>
|
||||
<methodname>fetch_field</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_fetch_field</function> regresa un objeto
|
||||
con información de definición de un campo de un resultado.
|
||||
Ejecute esta función repetidamente para obtener la información
|
||||
de todas las columnas en un resultado. <function>mysqli_fetch_field</function>
|
||||
regresa &false; cuando no hay más columnas en el resultado.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa un objeto el cual contiene la información de la definición
|
||||
del campo o &false; si no hay información disponible.
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title>Atributos del objeto</title>
|
||||
<tgroup cols='2'>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Atributo</entry>
|
||||
<entry>Descripción</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>El nombre de la columna</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>orgname</entry>
|
||||
<entry>Nombre original de la columna, si se específico un alias</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>table</entry>
|
||||
<entry>El nombre de la tablaa la cuál pertenece</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>orgtable</entry>
|
||||
<entry>Nombre original de la tabla si se específico un alias</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>def</entry>
|
||||
<entry>El valor por defecto de este campo, representado con una cadena</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>max_length</entry>
|
||||
<entry>La máma amplitud del campo para el resultado</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>flags</entry>
|
||||
<entry>Un entero representando los bit de bandera para el campo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>type</entry>
|
||||
<entry>El tipo de dato usado para este campo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>decimals</entry>
|
||||
<entry>El número de decimales utilizadas (para campos numéricos)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_num_fields</function>
|
||||
<function>mysqli_fetch_field_direct</function>
|
||||
<function>mysqli_fetch_fields</function>
|
||||
<function>mysqli_field_seek</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
||||
|
||||
if ($result = $mysqli->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 */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
/* Get field information for all fields */
|
||||
while ($finfo = mysqli_fetch_field($result)) {
|
||||
|
||||
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);
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Name: Name
|
||||
Table: Country
|
||||
max. Len: 11
|
||||
Flags: 1
|
||||
Type: 254
|
||||
|
||||
Name: SurfaceArea
|
||||
Table: Country
|
||||
max. Len: 10
|
||||
Flags: 32769
|
||||
Type: 4
|
||||
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
166
reference/mysqli/mysqli/functions/mysqli-fetch-fields.xml
Normal file
166
reference/mysqli/mysqli/functions/mysqli-fetch-fields.xml
Normal file
|
@ -0,0 +1,166 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-fields">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_fields</refname>
|
||||
<refname>result->fetch_fields</refname>
|
||||
<refpurpose>Regresa una matriz de objetos representando los campos en un
|
||||
resultado</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_fetch_fields</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos (método):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type>
|
||||
<methodname>fetch_fields</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Esta función sirve identica en propósito a la función
|
||||
<function>mysqli-fetch-field</function> con la minima diferencia de que,
|
||||
en lugar de regresar un objeto a la vez para cada campo, las columnas son
|
||||
regresadas como una matiz de objetos. Para una descripción de los
|
||||
atributos de cada objeto y su significado vea la función
|
||||
<function>mysqli_fetch_field</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Regresa una matriz de objetos que contienen la información de definició
|
||||
de los campos o &false; si no hay información del campo disponible.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_num_fields</function>
|
||||
<function>mysqli_fetch_field</function>
|
||||
<function>mysqli_fetch_field_direct</function>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
||||
|
||||
if ($result = $mysqli->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 */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
/* Get field information for all columns */
|
||||
$finfo = mysqli_fetch_fields($result);
|
||||
|
||||
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);
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Name: Name
|
||||
Table: Country
|
||||
max. Len: 11
|
||||
Flags: 1
|
||||
Type: 254
|
||||
|
||||
Name: SurfaceArea
|
||||
Table: Country
|
||||
max. Len: 10
|
||||
Flags: 32769
|
||||
Type: 4
|
||||
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
155
reference/mysqli/mysqli/functions/mysqli-fetch-lengths.xml
Normal file
155
reference/mysqli/mysqli/functions/mysqli-fetch-lengths.xml
Normal file
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch-lengths">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch_lengths</refname>
|
||||
<refname>result->lengths</refname>
|
||||
<refpurpose>Regresa la longitud de las columnas de la fila actual en el
|
||||
resultado</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>Estilo por procedimientos:</para>
|
||||
<methodsynopsis>
|
||||
<type>mixto</type><methodname>mysqli_fetch_lengths</methodname>
|
||||
<methodparam><type>objeto</type><parameter>resultado</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Estilo orientado a objetos(propiedad):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>resultado</classname></ooclass>
|
||||
<fieldsynopsis><type>mixto</type><varname>lengths</varname></fieldsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
La función <function>mysqli_fetch_lengths</function> regresa una matriz
|
||||
conteniendo la longitud de cada columna de la fila actual en el resultado
|
||||
representado por el parámetro <parameter>result</parameter>. Si hay
|
||||
información regresa una matriz numéricamente ordenada representando
|
||||
la longitud de cada columna o &false; si falla.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Valores regresados</title>
|
||||
<para>
|
||||
Una matriz de enteros representando el tamaño de cada columna (sin incluir
|
||||
el caracter NULL al final de la columna). &false; si ocurre un error.
|
||||
</para>
|
||||
<para>
|
||||
<function>mysql_fetch_lengths</function>Es valida solo para la fila actual
|
||||
en el resultado. Regresa &false; si se llama antes de ejecutar
|
||||
mysql_fetch_row/array/object o después de obtener todas las filas
|
||||
en el resultado.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Ejemplos</title>
|
||||
<example>
|
||||
<title>Estilo orientado a objetos</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 * from Country ORDER BY Code LIMIT 1";
|
||||
|
||||
if ($result = $mysqli->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 */
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Estilo por procedimientos</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 * from Country ORDER BY Code LIMIT 1";
|
||||
|
||||
if ($result = mysqli_query($link, $query)) {
|
||||
|
||||
$row = mysqli_fetch_row($result);
|
||||
|
||||
/* display column lengths */
|
||||
$lengths = mysqli_fetch_lengths($result);
|
||||
for ($i=0; $i < count($lengths); $i++) {
|
||||
printf("Field %2d has Length %2d\n", $i+1, $lengths[$i]);
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
/* close connection */
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los ejemplos anteriores producirán la siguiente salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Field 1 has Length 3
|
||||
Field 2 has Length 5
|
||||
Field 3 has Length 13
|
||||
Field 4 has Length 9
|
||||
Field 5 has Length 6
|
||||
Field 6 has Length 1
|
||||
Field 7 has Length 6
|
||||
Field 8 has Length 4
|
||||
Field 9 has Length 6
|
||||
Field 10 has Length 6
|
||||
Field 11 has Length 5
|
||||
Field 12 has Length 44
|
||||
Field 13 has Length 7
|
||||
Field 14 has Length 3
|
||||
Field 15 has Length 2
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
49
reference/mysqli/mysqli/functions/mysqli-fetch.xml
Normal file
49
reference/mysqli/mysqli/functions/mysqli-fetch.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: baoengb Status: ready -->
|
||||
<refentry id="function.mysqli-fetch">
|
||||
<refnamediv>
|
||||
<refname>mysqli_fetch</refname>
|
||||
<refpurpose>Alias de <function>mysqli_stmt_fetch</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Descripción</title>
|
||||
<para>
|
||||
Esta función es un alias de <function>mysqli_stmt_fetch</function>.
|
||||
Para una descripción más detallada vea
|
||||
<function>mysqli_stmt_fetch</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqli_fetch</function> es obsoleta y será removida.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Vea también</title>
|
||||
<para>
|
||||
<function>mysqli_stmt_fetch</function>
|
||||
</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
|
||||
-->
|
Loading…
Reference in a new issue